]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix a potential memory leak in a P2P+NFC corner case
authorPurushottam Kushwaha <p.kushwaha@samsung.com>
Fri, 29 May 2015 09:20:41 +0000 (09:20 +0000)
committerJouni Malinen <j@w1.fi>
Fri, 29 May 2015 17:41:25 +0000 (20:41 +0300)
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>
wpa_supplicant/wps_supplicant.c

index 8a5cb8e8fbd4946bc0b8b410f0052967169ce855..61a85876b0cff49c6f9dcc1038662f2ca9d64e7a 100644 (file)
@@ -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;