Fix memory leak on wpa_supplicant_init_wpa() error path

If wpa_sm_init() fails, the context data needs to be freed in the
caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
master
Jouni Malinen 10 years ago
parent 52a80583ba
commit ef0355780a

@ -1040,6 +1040,7 @@ int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)
if (wpa_s->wpa == NULL) {
wpa_printf(MSG_ERROR, "Failed to initialize WPA state "
"machine");
os_free(ctx);
return -1;
}
#endif /* CONFIG_NO_WPA */

Loading…
Cancel
Save