From: Jouni Malinen Date: Sat, 28 Dec 2013 12:23:43 +0000 (+0200) Subject: Fix PeerKey deinit behavior X-Git-Tag: hostap_2_1~337 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=773272989a71f772ee675bd7e92c131aaa323903;p=thirdparty%2Fhostap.git Fix PeerKey deinit behavior PeerKey entries need to be removed on disassociation and this needs to be done in a way that cancels the possibly pending eloop timeout. Signed-hostap: Jouni Malinen --- diff --git a/src/rsn_supp/peerkey.c b/src/rsn_supp/peerkey.c index 76714f8df..cb86dfbcc 100644 --- a/src/rsn_supp/peerkey.c +++ b/src/rsn_supp/peerkey.c @@ -1110,7 +1110,7 @@ void peerkey_deinit(struct wpa_sm *sm) while (peerkey) { prev = peerkey; peerkey = peerkey->next; - os_free(prev); + wpa_supplicant_peerkey_free(sm, prev); } sm->peerkey = NULL; } diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 109d07bed..d26a7a8b0 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -2098,6 +2098,7 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) */ void wpa_sm_notify_disassoc(struct wpa_sm *sm) { + peerkey_deinit(sm); rsn_preauth_deinit(sm); pmksa_cache_clear_current(sm); if (wpa_sm_get_state(sm) == WPA_4WAY_HANDSHAKE)