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:
parent
52a80583ba
commit
ef0355780a
1 changed files with 1 additions and 0 deletions
|
@ -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…
Reference in a new issue