From ef0355780abc29cb33d04b6c24f4560f32bf47a2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 6 Jan 2015 23:01:00 +0200 Subject: [PATCH] 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 --- wpa_supplicant/wpas_glue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c index 3098058b1..209e2bceb 100644 --- a/wpa_supplicant/wpas_glue.c +++ b/wpa_supplicant/wpas_glue.c @@ -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 */