From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8ACB795DB for ; Mon, 20 Jun 2016 17:23:10 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 20 Jun 2016 08:23:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,499,1459839600"; d="scan'208";a="979714326" Received: from rhorton-mobl.ger.corp.intel.com (HELO VM.ir.intel.com) ([163.33.228.132]) by orsmga001.jf.intel.com with ESMTP; 20 Jun 2016 08:23:09 -0700 From: Remy Horton To: dev@dpdk.org, Pablo de Lara Date: Mon, 20 Jun 2016 16:23:06 +0100 Message-Id: <1466436187-5225-2-git-send-email-remy.horton@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466436187-5225-1-git-send-email-remy.horton@intel.com> References: <1466436187-5225-1-git-send-email-remy.horton@intel.com> Subject: [dpdk-dev] [PATCH v2 1/2] app/test-pmd: fix Coverity issues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:23:10 -0000 Fixes memory leaks detected by Coverity. These are due to ephemeral memory allocations not being freed when errors occur. Coverity issue 127348: Resource leak Fixes: e2aae1c1ced9 ("ethdev: remove name from extended statistic fetch") Signed-off-by: Remy Horton --- app/test-pmd/config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 10f0a36..cb71c09 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -281,6 +281,7 @@ nic_xstats_display(portid_t port_id) if (cnt_xstats != rte_eth_xstats_get_names( port_id, xstats_names, cnt_xstats)) { printf("Error: Cannot get xstats lookup\n"); + free(xstats_names); return; } @@ -293,6 +294,8 @@ nic_xstats_display(portid_t port_id) } if (cnt_xstats != rte_eth_xstats_get(port_id, xstats, cnt_xstats)) { printf("Error: Unable to get xstats\n"); + free(xstats_names); + free(xstats); return; } -- 2.5.5