[PATCH 1/7] wpa_supplicant: fix memroy leak in ieee802_11_vendor_ie_concat()

Ilan Peer ilan.peer
Mon Feb 10 02:55:03 PST 2014


From: Eytan Lifshitz <eytan.lifshitz at intel.com>

Memory allocated by calling function ieee802_11_vendor_ie_concat
isn't freed in some case. fixed.

Signed-hostap: Eytan Lifshitz <eytan.lifshitz at intel.com>
---
 wpa_supplicant/ctrl_iface.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index ddddad3..494e0d5 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -3490,8 +3490,10 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
 						  WFD_IE_VENDOR_TYPE);
 		if (wfd) {
 			ret = os_snprintf(pos, end - pos, "wfd_subelems=");
-			if (ret < 0 || ret >= end - pos)
+			if (ret < 0 || ret >= end - pos) {
+				wpabuf_free(wfd);
 				return 0;
+			}
 			pos += ret;
 
 			pos += wpa_snprintf_hex(pos, end - pos,
-- 
1.7.10.4




More information about the Hostap mailing list