From 5e6aa04b0995bc30b766e48d03eba81a4e2332d1 Mon Sep 17 00:00:00 2001 From: Eytan Lifshitz Date: Mon, 10 Feb 2014 12:55:03 +0200 Subject: [PATCH] wpa_supplicant: Fix memory leak in wfd_subelems error path Memory allocated by calling function ieee802_11_vendor_ie_concat() was not freed on an error path int ctrl_iface BSS command. Signed-hostap: Eytan Lifshitz --- 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 ed332da88..663f40974 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3504,8 +3504,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,