From: Jouni Malinen Date: Thu, 8 Jan 2015 00:22:03 +0000 (+0200) Subject: Fix a memory leak on WPA authenticator error path X-Git-Tag: hostap_2_4~505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27d9701dea99cabde6e8afb363b4f107c371da46;p=thirdparty%2Fhostap.git Fix a memory leak on WPA authenticator error path wpa_auth->group needs to be freed if PMK cache setup fails. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index da2073c0a..059b8848d 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -415,6 +415,7 @@ struct wpa_authenticator * wpa_init(const u8 *addr, wpa_auth); if (wpa_auth->pmksa == NULL) { wpa_printf(MSG_ERROR, "PMKSA cache initialization failed."); + os_free(wpa_auth->group); os_free(wpa_auth->wpa_ie); os_free(wpa_auth); return NULL; @@ -424,6 +425,7 @@ struct wpa_authenticator * wpa_init(const u8 *addr, wpa_auth->ft_pmk_cache = wpa_ft_pmk_cache_init(); if (wpa_auth->ft_pmk_cache == NULL) { wpa_printf(MSG_ERROR, "FT PMK cache initialization failed."); + os_free(wpa_auth->group); os_free(wpa_auth->wpa_ie); pmksa_cache_auth_deinit(wpa_auth->pmksa); os_free(wpa_auth);