[PATCH] Fix wpa_priv memory leak in wpa_priv_get_scan_results2()

Dmitry Shmidt dimitrysh at google.com
Wed Dec 2 16:55:28 EST 2009


Hi,

I suspect that new scan results format demands more complex free procedure.

Thanks,

Dmitry

---

diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 4a27125..4ff0284 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -172,12 +172,12 @@ static void wpa_priv_get_scan_results2(struct
wpa_priv_interface *iface,
 	       sizeof(*from));

 	os_free(buf);
-	os_free(res);
+	wpa_scan_results_free(res);
 	return;

 fail:
 	os_free(buf);
-	os_free(res);
+	wpa_scan_results_free(res);
 	sendto(iface->fd, "", 0, 0, (struct sockaddr *) from, sizeof(*from));
 }


More information about the HostAP mailing list