aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-07-04 14:34:19 (GMT)
committerJouni Malinen <j@w1.fi>2016-07-04 14:49:15 (GMT)
commit8329ad4d0687c0d4750df36d3e04ca08aefe54bc (patch)
treea437dbbba7208eb3c4faa01e1d04c68fb7115558 /wpa_supplicant
parentc8fa30f21380b2829a783d3f7e5b6f8c9ed50aae (diff)
downloadhostap-8329ad4d0687c0d4750df36d3e04ca08aefe54bc.zip
hostap-8329ad4d0687c0d4750df36d3e04ca08aefe54bc.tar.gz
hostap-8329ad4d0687c0d4750df36d3e04ca08aefe54bc.tar.bz2
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 <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 0571c23..ce631dd 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 */