[PATCH] Fix wpa_priv memory leak in wpa_priv_get_scan_results2()

Dmitry Shmidt dimitrysh
Wed Dec 2 13:55:28 PST 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