From patchwork Thu Jun 8 08:17:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 772916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wjyzz0jzjz9s7t for ; Thu, 8 Jun 2017 18:21:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Kb9GYxk9"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=myLkc+fK4lKiqO2EXTrERWSee7Hmlw80F9CnTNrEnCw=; b=Kb9 GYxk90/cBvsaWyR0VtTf3d3juvi1ZVZ5UzX5yyYMxgJ8aQFo20Lp8YiDeUCCujh2Ax0UKUaRCfw1v fjPxbVqn7zumJAMnD6FUNRN+3RA4hbt9x5O34SUmwqT0KTRGybk5udN6cWKt8yYMYjNuqrUKdEhe2 q/S6dLibr+gkPihxIe/8Y+TwI2Av9rrspMUc/j3elAe3TlTbFaK+fQSG93nefE4jJzNP3diQTFM/S GBgG9v8gXLN49Ro8q+Z9M99VdNEkR77KB8/IREckjJ5MLFhfHF272l+9EdTOOycGI24V78b64tWfT /lzbUCtmg4T3pSOT4DqwZfzzdfYuaVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIsgK-00063v-Ow; Thu, 08 Jun 2017 08:20:40 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dIsfi-0004PW-W7 for hostap@lists.infradead.org; Thu, 08 Jun 2017 08:20:04 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2017 01:19:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.39,314,1493708400"; d="scan'208"; a="1179822137" Received: from temphostname.jer.intel.com ([10.12.217.219]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2017 01:19:41 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH] MBO: Fix possible memory leak in anqp_send_req() Date: Thu, 8 Jun 2017 11:17:58 +0300 Message-Id: <1496909880-3511-5-git-send-email-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170608_012003_061756_11CD21C4 X-CRM114-Status: UNSURE ( 8.31 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.55.52.88 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.55.52.88 listed in wl.mailspike.net] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ilan Peer MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ilan Peer 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 --- wpa_supplicant/interworking.c | 1 + 1 file changed, 1 insertion(+) 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);