aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPurushottam Kushwaha <p.kushwaha@samsung.com>2015-05-29 09:20:41 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-29 17:41:25 (GMT)
commiteda9d84dfdfad332213a708dcd7b7680078aeb66 (patch)
treef92669fe203abd5a2a688db0702f2704ccb45d25
parent701d9729b3a7ff574c9ff29048b82c00df1a6a68 (diff)
downloadhostap-eda9d84dfdfad332213a708dcd7b7680078aeb66.zip
hostap-eda9d84dfdfad332213a708dcd7b7680078aeb66.tar.gz
hostap-eda9d84dfdfad332213a708dcd7b7680078aeb66.tar.bz2
P2P: Fix a potential memory leak in a P2P+NFC corner case
Avoid memory leak due to previous allocation for ssid->ssid. It does not look like this is hit in normal cases, but at might be possible for the SSID to get set if the peer is present in previous scan results and WPS code ends up copying the SSID from there. Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
-rw-r--r--wpa_supplicant/wps_supplicant.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 8a5cb8e..61a8587 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1187,6 +1187,7 @@ static int wpas_wps_start_dev_pw(struct wpa_supplicant *wpa_s,
}
#ifdef CONFIG_P2P
if (p2p_group && wpa_s->go_params && wpa_s->go_params->ssid_len) {
+ os_free(ssid->ssid);
ssid->ssid = os_zalloc(wpa_s->go_params->ssid_len + 1);
if (ssid->ssid) {
ssid->ssid_len = wpa_s->go_params->ssid_len;