From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 94B571B22A for ; Fri, 22 Dec 2017 01:01:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 16:01:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,438,1508828400"; d="scan'208";a="14698242" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga004.fm.intel.com with ESMTP; 21 Dec 2017 16:01:31 -0800 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.208]) by ORSMSX106.amr.corp.intel.com ([10.22.225.133]) with mapi id 14.03.0319.002; Thu, 21 Dec 2017 16:01:30 -0800 From: "Wang, Yipeng1" To: "Burakov, Anatoly" , "dev@dpdk.org" CC: "Gobriel, Sameh" Thread-Topic: [PATCH] member: fix memory leak on error Thread-Index: AQHTeoRMZDYHMla/6k69gJZeCbOEu6NOZ1JQ Date: Fri, 22 Dec 2017 00:01:30 +0000 Message-ID: References: <5c0a540f8917604a86e18f8da77fa0c2013b7fde.1513865858.git.anatoly.burakov@intel.com> In-Reply-To: <5c0a540f8917604a86e18f8da77fa0c2013b7fde.1513865858.git.anatoly.burakov@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTcxMjA0YWEtZmZkZC00NWE5LWJhOGItZTY2NmNjOTJjNmY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlhiaU5rc0JWOFFwaDFpck9xOThMdkVuMWhrU1NncFdSUk5rRWlPeWFOaXc9In0= x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] member: fix memory leak on error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 00:01:33 -0000 Thank you Anatoly for finding this issue. In the code I tried to reuse the = rte_member_free function to free memory but it may not be executed through.= =20 Because of this, I may not properly release setsum struct neither. I will p= ost a fix for both soon. Thanks >-----Original Message----- >From: Burakov, Anatoly >Sent: Thursday, December 21, 2017 9:51 AM >To: dev@dpdk.org >Cc: Wang, Yipeng1 ; Gobriel, Sameh > >Subject: [PATCH] member: fix memory leak on error > >rte_member may have allocated a tailq entry before failure, so >free it. > >Fixes: 857ed6c68cf2 ("member: implement main API") >Cc: yipeng1.wang@intel.com >Signed-off-by: Anatoly Burakov >--- > lib/librte_member/rte_member.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/lib/librte_member/rte_member.c >b/lib/librte_member/rte_member.c >index cc9ea84..569fff9 100644 >--- a/lib/librte_member/rte_member.c >+++ b/lib/librte_member/rte_member.c >@@ -191,6 +191,7 @@ rte_member_create(const struct >rte_member_parameters *params) > return setsum; > > error_unlock_exit: >+ rte_free(te); > rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); > rte_member_free(setsum); > return NULL; >-- >2.7.4