Fix a memory leak in WPS with ap_scan=2

The wpa_ie buffer is now allocated here and needs to be freed before
returning from the function.

Fixes: d2ba0d719e ("Move assoc param setting into a helper function")
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2021-02-28 18:46:32 +02:00
parent 900adb3c9f
commit 40551a15c1

View file

@ -3559,6 +3559,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
wpa_s->scan_req = MANUAL_SCAN_REQ; wpa_s->scan_req = MANUAL_SCAN_REQ;
wpa_s->reassociate = 1; wpa_s->reassociate = 1;
wpa_supplicant_req_scan(wpa_s, 0, 0); wpa_supplicant_req_scan(wpa_s, 0, 0);
os_free(wpa_ie);
return; return;
#endif /* CONFIG_WPS */ #endif /* CONFIG_WPS */
} else { } else {