aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-06 21:01:00 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-07 11:19:00 (GMT)
commitef0355780abc29cb33d04b6c24f4560f32bf47a2 (patch)
treeed07a1119e2b6633e2f6978ea9ea33defc024a72 /wpa_supplicant
parent52a80583ba56624358cfb1aa4ca6303420859e2f (diff)
downloadhostap-ef0355780abc29cb33d04b6c24f4560f32bf47a2.zip
hostap-ef0355780abc29cb33d04b6c24f4560f32bf47a2.tar.gz
hostap-ef0355780abc29cb33d04b6c24f4560f32bf47a2.tar.bz2
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>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpas_glue.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 3098058..209e2bc 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 */