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>
This commit is contained in:
Jouni Malinen 2015-01-06 23:01:00 +02:00
parent 52a80583ba
commit ef0355780a

View File

@ -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 */