aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-29 11:05:32 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-29 17:44:51 (GMT)
commitce52d031e5389c81796db863e2cba41b982e1f07 (patch)
treea51588601fd8e1767ffa77c30d48660b8ac255f3 /wpa_supplicant/ap.c
parent7d711541dced759b34313477d5d163e65c5b0131 (diff)
downloadhostap-ce52d031e5389c81796db863e2cba41b982e1f07.zip
hostap-ce52d031e5389c81796db863e2cba41b982e1f07.tar.gz
hostap-ce52d031e5389c81796db863e2cba41b982e1f07.tar.bz2
Clear wpa_psk memory when setting up wpa_supplicant AP mode
This is more of a theoretical case since this part is done only during setup and the structure is not allocated in practice. Anyway, maintaining more consistent use of bin_clear_free() for structures that may contain keys is useful. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 64a0120..2ebc7f6 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -225,7 +225,7 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
bss->wpa_key_mgmt = ssid->key_mgmt;
bss->wpa_pairwise = ssid->pairwise_cipher;
if (ssid->psk_set) {
- os_free(bss->ssid.wpa_psk);
+ bin_clear_free(bss->ssid.wpa_psk, sizeof(*bss->ssid.wpa_psk));
bss->ssid.wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk));
if (bss->ssid.wpa_psk == NULL)
return -1;