From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4AC031B3B3 for ; Thu, 2 Nov 2017 11:14:02 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2017 03:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,333,1505804400"; d="scan'208";a="145076777" Received: from silpixa00389036.ir.intel.com (HELO silpixa00389036.ger.corp.intel.com) ([10.237.223.231]) by orsmga004.jf.intel.com with ESMTP; 02 Nov 2017 03:13:59 -0700 From: Kirill Rybalchenko To: dev@dpdk.org Cc: kirill.rybalchenko@intel.com, andrey.chilikin@intel.com, jingjing.wu@intel.com Date: Thu, 2 Nov 2017 10:13:41 +0000 Message-Id: <1509617621-24850-1-git-send-email-kirill.rybalchenko@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] app/testpmd: fix potential 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: Thu, 02 Nov 2017 10:14:02 -0000 Fix potential memory leak in cmd_ddp_info_parsed() function. Fixes: a8e005696c7b ("app/testpmd: get ddp profile protocol info") Signed-off-by: Kirill Rybalchenko --- app/test-pmd/cmdline.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 3b691fe..eb044e7 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -14362,7 +14362,7 @@ cmd_ddp_info_parsed( uint32_t dev_num = 0; struct rte_pmd_i40e_ddp_device_id *devs; uint32_t proto_num = 0; - struct rte_pmd_i40e_proto_info *proto; + struct rte_pmd_i40e_proto_info *proto = NULL; uint32_t pctype_num = 0; struct rte_pmd_i40e_ptype_info *pctype; uint32_t ptype_num = 0; @@ -14541,9 +14541,10 @@ cmd_ddp_info_parsed( free(ptype); printf("\n"); - free(proto); ret = 0; no_print_return: + if (proto) + free(proto); #endif if (ret == -ENOTSUP) printf("Function not supported in PMD driver\n"); -- 2.5.5