]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear psk_list while freeing config_ssid instances
authorJouni Malinen <j@w1.fi>
Mon, 29 Dec 2014 11:11:29 +0000 (13:11 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Dec 2014 17:44:51 +0000 (19:44 +0200)
Previously, the main PSK entry was cleared explicitly, but psk_list
could include PSKs for some P2P use cases, so clear it as well when
freeing config_ssid instances.

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

index d3a8c86ffd0b98177a3bf044b8e9e1fd67f23381..f478a040f96cc48e14de1bf6f0b5a764c782bbaa 100644 (file)
@@ -2078,7 +2078,6 @@ void wpa_config_free_ssid(struct wpa_ssid *ssid)
        struct psk_list_entry *psk;
 
        os_free(ssid->ssid);
-       os_memset(ssid->psk, 0, sizeof(ssid->psk));
        str_clear_free(ssid->passphrase);
        os_free(ssid->ext_psk);
 #ifdef IEEE8021X_EAPOL
@@ -2098,9 +2097,9 @@ void wpa_config_free_ssid(struct wpa_ssid *ssid)
        while ((psk = dl_list_first(&ssid->psk_list, struct psk_list_entry,
                                    list))) {
                dl_list_del(&psk->list);
-               os_free(psk);
+               bin_clear_free(psk, sizeof(*psk));
        }
-       os_free(ssid);
+       bin_clear_free(ssid, sizeof(*ssid));
 }