From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 43C781B220 for ; Fri, 22 Dec 2017 01:07:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 16:07:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,438,1508828400"; d="scan'208";a="3892760" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by fmsmga002.fm.intel.com with ESMTP; 21 Dec 2017 16:07:53 -0800 Received: from orsmsx158.amr.corp.intel.com (10.22.240.20) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 16:07:53 -0800 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.208]) by ORSMSX158.amr.corp.intel.com ([169.254.10.25]) with mapi id 14.03.0319.002; Thu, 21 Dec 2017 16:07:52 -0800 From: "Wang, Yipeng1" To: "Burakov, Anatoly" , "dev@dpdk.org" CC: "Gobriel, Sameh" , "De Lara Guarch, Pablo" Thread-Topic: [PATCH] member: fix memory leak on error Thread-Index: AQHTeoRMZDYHMla/6k69gJZeCbOEu6NOZ1JQgAAU7uA= Date: Fri, 22 Dec 2017 00:07:52 +0000 Message-ID: References: <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:07:55 -0000 Btw, Pablo, since I remember I refer to the EFD library on my membership im= plementation, does EFD have similar memory leakage issue that not releasing= te when failure? Thanks >-----Original Message----- >From: Wang, Yipeng1 >Sent: Thursday, December 21, 2017 4:01 PM >To: Burakov, Anatoly ; dev@dpdk.org >Cc: Gobriel, Sameh >Subject: RE: [PATCH] member: fix memory leak on error > >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. > >Because of this, I may not properly release setsum struct neither. I will = post 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