From: Shan Palanisamy Date: Thu, 16 Feb 2012 17:32:48 +0000 (+0200) Subject: Clear wpa_psk/passphrase when the other option is configured X-Git-Tag: hostap_2_0~875 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31b540ebd5279da9f085bcf2a77ba25e79f0e90e;p=thirdparty%2Fhostap.git Clear wpa_psk/passphrase when the other option is configured Signed-hostap: Jouni Malinen --- diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 78f1e3d0b..818c10b8e 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -1605,6 +1605,8 @@ struct hostapd_config * hostapd_config_read(const char *fname) } else { os_free(bss->ssid.wpa_passphrase); bss->ssid.wpa_passphrase = os_strdup(pos); + os_free(bss->ssid.wpa_psk); + bss->ssid.wpa_psk = NULL; } } else if (os_strcmp(buf, "wpa_psk") == 0) { os_free(bss->ssid.wpa_psk); @@ -1620,6 +1622,8 @@ struct hostapd_config * hostapd_config_read(const char *fname) errors++; } else { bss->ssid.wpa_psk->group = 1; + os_free(bss->ssid.wpa_passphrase); + bss->ssid.wpa_passphrase = NULL; } } else if (os_strcmp(buf, "wpa_psk_file") == 0) { os_free(bss->ssid.wpa_psk_file);