From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 439615F27; Wed, 14 Nov 2018 12:59:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 03:59:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,232,1539673200"; d="scan'208";a="91033549" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.222.149]) by orsmga006.jf.intel.com with ESMTP; 14 Nov 2018 03:58:59 -0800 From: Jasvinder Singh To: dev@dpdk.org Cc: stable@dpdk.org, bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com Date: Wed, 14 Nov 2018 11:58:59 +0000 Message-Id: <20181114115859.160722-1-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] testpmd: fix memory leak for dscp table X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 11:59:03 -0000 Fix memory leak for dscp table reported by coverity Coverity ID: 326961 Fixes: 281eeb8afc55 ("app/testpmd: add commands for metering and policing") CC: stable@dpdk.org Signed-off-by: Jasvinder Singh --- app/test-pmd/cmdline_mtr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c index 846de88db..c506d87ee 100644 --- a/app/test-pmd/cmdline_mtr.c +++ b/app/test-pmd/cmdline_mtr.c @@ -1148,15 +1148,15 @@ static void cmd_set_port_meter_dscp_table_parsed(void *parsed_result, } if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; + goto free_table; /* Update Meter DSCP Table*/ ret = rte_mtr_meter_dscp_table_update(port_id, mtr_id, dscp_table, &error); - if (ret != 0) { + if (ret != 0) print_err_msg(&error); - return; - } + +free_table: free(dscp_table); } -- 2.17.1