From 8329ad4d0687c0d4750df36d3e04ca08aefe54bc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 4 Jul 2016 17:34:19 +0300 Subject: [PATCH] Fix wpa_config_get_all() error path The previous version did not really work at all and it ended up crashing if the os_strdup(field->name) call failed. Signed-off-by: Jouni Malinen --- wpa_supplicant/config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 0571c232d..ce631dd7e 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2669,9 +2669,8 @@ char ** wpa_config_get_all(struct wpa_ssid *ssid, int get_keys) return props; err: - value = *props; - while (value) - os_free(value++); + for (i = 0; props[i]; i++) + os_free(props[i]); os_free(props); return NULL; #endif /* NO_CONFIG_WRITE */