mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 19:04:02 -05:00
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 <j@w1.fi>
This commit is contained in:
parent
c1c07dcb70
commit
27d9701dea
@ -415,6 +415,7 @@ struct wpa_authenticator * wpa_init(const u8 *addr,
|
|||||||
wpa_auth);
|
wpa_auth);
|
||||||
if (wpa_auth->pmksa == NULL) {
|
if (wpa_auth->pmksa == NULL) {
|
||||||
wpa_printf(MSG_ERROR, "PMKSA cache initialization failed.");
|
wpa_printf(MSG_ERROR, "PMKSA cache initialization failed.");
|
||||||
|
os_free(wpa_auth->group);
|
||||||
os_free(wpa_auth->wpa_ie);
|
os_free(wpa_auth->wpa_ie);
|
||||||
os_free(wpa_auth);
|
os_free(wpa_auth);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -424,6 +425,7 @@ struct wpa_authenticator * wpa_init(const u8 *addr,
|
|||||||
wpa_auth->ft_pmk_cache = wpa_ft_pmk_cache_init();
|
wpa_auth->ft_pmk_cache = wpa_ft_pmk_cache_init();
|
||||||
if (wpa_auth->ft_pmk_cache == NULL) {
|
if (wpa_auth->ft_pmk_cache == NULL) {
|
||||||
wpa_printf(MSG_ERROR, "FT PMK cache initialization failed.");
|
wpa_printf(MSG_ERROR, "FT PMK cache initialization failed.");
|
||||||
|
os_free(wpa_auth->group);
|
||||||
os_free(wpa_auth->wpa_ie);
|
os_free(wpa_auth->wpa_ie);
|
||||||
pmksa_cache_auth_deinit(wpa_auth->pmksa);
|
pmksa_cache_auth_deinit(wpa_auth->pmksa);
|
||||||
os_free(wpa_auth);
|
os_free(wpa_auth);
|
||||||
|
Loading…
Reference in New Issue
Block a user