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 BBBC1A499 for ; Tue, 8 May 2018 16:29:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2018 07:29:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,378,1520924400"; d="scan'208";a="222593909" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga005.jf.intel.com with ESMTP; 08 May 2018 07:29:03 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX154.ger.corp.intel.com (163.33.192.96) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 15:29:02 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by IRSMSX156.ger.corp.intel.com ([169.254.3.233]) with mapi id 14.03.0319.002; Tue, 8 May 2018 15:29:02 +0100 From: "Dumitrescu, Cristian" To: "Singh, Jasvinder" , "dev@dpdk.org" Thread-Topic: [PATCH] examples/ip_pipeline: fix memory leak Thread-Index: AQHT1Zx08HO/oi92CEGPmeSCgYRmMaQmBpAQ Date: Tue, 8 May 2018 14:29:02 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BB667C4@IRSMSX108.ger.corp.intel.com> References: <20180416160311.112470-1-jasvinder.singh@intel.com> In-Reply-To: <20180416160311.112470-1-jasvinder.singh@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.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] 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 memory 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: Tue, 08 May 2018 14:29:06 -0000 > -----Original Message----- > From: Singh, Jasvinder > Sent: Monday, April 16, 2018 5:03 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian > Subject: [PATCH] examples/ip_pipeline: fix memory leak >=20 > Close the file stream before returning from the function to avoid > memory leak. >=20 > Fixes: 2b82ef4861c0 ("examples/ip_pipeline: add DSCP table update > command") > Coverty Issue: 272605 >=20 > Signed-off-by: Jasvinder Singh > --- > examples/ip_pipeline/cli.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c > index 199a31f..20fbefb 100644 > --- a/examples/ip_pipeline/cli.c > +++ b/examples/ip_pipeline/cli.c > @@ -4158,6 +4158,7 @@ load_dscp_table(struct > rte_table_action_dscp_table *dscp_table, >=20 > if (parse_tokenize_string(line, tokens, &n_tokens)) { > *line_number =3D l; > + fclose(f); > return -EINVAL; > } >=20 > @@ -4172,6 +4173,7 @@ load_dscp_table(struct > rte_table_action_dscp_table *dscp_table, > (tc_queue_id >=3D > RTE_TABLE_ACTION_TC_QUEUE_MAX) || > (strlen(tokens[2]) !=3D 1)) { > *line_number =3D l; > + fclose(f); > return -EINVAL; > } >=20 > @@ -4193,6 +4195,7 @@ load_dscp_table(struct > rte_table_action_dscp_table *dscp_table, >=20 > default: > *line_number =3D l; > + fclose(f); > return -EINVAL; > } >=20 > -- > 2.9.3 Acked-by: Cristian.Dumitrescu Applied to next-pipeline tree, thanks!