]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Fix memory leak in wfd_subelems error path
authorEytan Lifshitz <eytan.lifshitz@intel.com>
Mon, 10 Feb 2014 10:55:03 +0000 (12:55 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 13 Feb 2014 13:41:15 +0000 (15:41 +0200)
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 <eytan.lifshitz@intel.com>

wpa_supplicant/ctrl_iface.c

index ed332da8875daab63893d6b7a8598370d9b06105..663f4097405135a96b6356aa2ce1550d47472ed9 100644 (file)
@@ -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,