diff mbox

MBO: Fix possible memory leak in anqp_send_req()

Message ID 1496909880-3511-5-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show

Commit Message

Andrei Otcheretianski June 8, 2017, 8:17 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

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 | 1 +
 1 file changed, 1 insertion(+)

Comments

Jouni Malinen July 8, 2017, 7:33 p.m. UTC | #1
On Thu, Jun 08, 2017 at 11:17:58AM +0300, Andrei Otcheretianski wrote:
> In case that an mbo object is allocated, but there is a failure
> to resize the wpabuf, need to free the mbo object.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 3b4b639..dd5a724 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);