]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Fix possible memory leak in anqp_send_req()
authorIlan Peer <ilan.peer@intel.com>
Thu, 8 Jun 2017 08:17:58 +0000 (11:17 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 8 Jul 2017 13:14:03 +0000 (16:14 +0300)
In case that an mbo object is allocated, but there is a failure
to resize the wpabuf, need to free the mbo object.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
wpa_supplicant/interworking.c

index 3b4b639fd06bc2614d7ec99105b15d7f6abf172a..dd5a7249c906d9428b879f4839fd236dc476ee76 100644 (file)
@@ -2738,6 +2738,7 @@ int anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst,
                if (mbo) {
                        if (wpabuf_resize(&extra_buf, wpabuf_len(mbo))) {
                                wpabuf_free(extra_buf);
+                               wpabuf_free(mbo);
                                return -1;
                        }
                        wpabuf_put_buf(extra_buf, mbo);