From: Ilan Peer Date: Thu, 8 Jun 2017 08:17:58 +0000 (+0300) Subject: MBO: Fix possible memory leak in anqp_send_req() X-Git-Tag: hostap_2_7~1197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=422570eec805331de05156244b6301d5d8b6a998;p=thirdparty%2Fhostap.git MBO: Fix possible memory leak in anqp_send_req() 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 --- diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 3b4b639fd..dd5a7249c 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -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);