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>
This commit is contained in:
parent
c8fa30f213
commit
8329ad4d06
1 changed files with 2 additions and 3 deletions
|
@ -2669,9 +2669,8 @@ char ** wpa_config_get_all(struct wpa_ssid *ssid, int get_keys)
|
||||||
return props;
|
return props;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
value = *props;
|
for (i = 0; props[i]; i++)
|
||||||
while (value)
|
os_free(props[i]);
|
||||||
os_free(value++);
|
|
||||||
os_free(props);
|
os_free(props);
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif /* NO_CONFIG_WRITE */
|
#endif /* NO_CONFIG_WRITE */
|
||||||
|
|
Loading…
Reference in a new issue