From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id B4F2F8D8D for ; Thu, 19 Apr 2018 17:32:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2018 08:32:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,469,1517904000"; d="scan'208";a="48263698" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga001.fm.intel.com with ESMTP; 19 Apr 2018 08:32:50 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 19 Apr 2018 16:32:49 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.176]) by irsmsx111.ger.corp.intel.com ([169.254.2.167]) with mapi id 14.03.0319.002; Thu, 19 Apr 2018 16:32:49 +0100 From: "Singh, Jasvinder" To: "Laatz, Kevin" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" Thread-Topic: [PATCH] examples/ip_pipeline: fix resource leak Thread-Index: AQHT184yZLCvnYIeM0CURnp7DtBtDaQIN36Q Date: Thu, 19 Apr 2018 15:32:49 +0000 Message-ID: <54CBAA185211B4429112C315DA58FF6D33342B8F@IRSMSX101.ger.corp.intel.com> References: <20180419110418.8099-1-kevin.laatz@intel.com> In-Reply-To: <20180419110418.8099-1-kevin.laatz@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGJiY2Q1ZmQtOGFlYi00ZmNmLTg4NWQtZTEzMDMzY2JiYjIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im9Qa0pVWGlFeFUrTWZ6Y1wvY1I3UWFpMlFSQVhpdlBJeVF4czlkdzNkcXNJPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/ip_pipeline: fix resource leak 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: Thu, 19 Apr 2018 15:32:53 -0000 > -----Original Message----- > From: Laatz, Kevin > Sent: Thursday, April 19, 2018 12:04 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Laatz, Kevin > ; Singh, Jasvinder > Subject: [PATCH] examples/ip_pipeline: fix resource leak >=20 > Closing the fd_server file descriptor on error to fix the resource leak. >=20 > Coverity issue: 272587 > Fixes: 4bbf8e30aa5e ("examples/ip_pipeline: add CLI interface") > Cc: jasvinder.singh@intel.com >=20 > Signed-off-by: Kevin Laatz > --- > examples/ip_pipeline/conn.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/examples/ip_pipeline/conn.c b/examples/ip_pipeline/conn.c in= dex > 9338942..6b08e9e 100644 > --- a/examples/ip_pipeline/conn.c > +++ b/examples/ip_pipeline/conn.c > @@ -96,12 +96,14 @@ conn_init(struct conn_params *p) > sizeof(server_address)); > if (status =3D=3D -1) { > conn_free(conn); > + close(fd_server); > return NULL; > } >=20 > status =3D listen(fd_server, 16); > if (status =3D=3D -1) { > conn_free(conn); > + close(fd_server); > return NULL; > } >=20 > @@ -109,6 +111,7 @@ conn_init(struct conn_params *p) > fd_client_group =3D epoll_create(1); > if (fd_client_group =3D=3D -1) { > conn_free(conn); > + close(fd_server); > return NULL; > } >=20 > -- > 2.9.5 Reviewed-by: Jasvinder Singh