]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix memory leak on wpa_supplicant_init_wpa() error path
authorJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 21:01:00 +0000 (23:01 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 7 Jan 2015 11:19:00 +0000 (13:19 +0200)
If wpa_sm_init() fails, the context data needs to be freed in the
caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpas_glue.c

index 3098058b1fb210f6c3c34b2c8075a1deffceb5e7..209e2bcebf7914be4cd5ae86841c53c597d7ba95 100644 (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 */