From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D0DAA0547; Wed, 29 Jun 2022 17:37:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9274B400D7; Wed, 29 Jun 2022 17:37:28 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 9CAC140042; Wed, 29 Jun 2022 17:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656517046; x=1688053046; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=is2MMkOHk6U5zQ6QPE0Tan45O+V/rDe0oVQMdiDBHxI=; b=EuFM0Rfqf8U4PwQcH8qaHGVKNhj+HGp2KsRh/B4HrQmtbv7CzUi2sxVF SQyDrU6rIgUCJEDDeT1Q6w5wUbElX+SE77LJzXz9rNJTaiHjtMGaEeEiG sPoIzlNtjXFtXXagdTw2m3msIAdyAOfGOioJOUAa0OO7UcyuIgQxOIswc rkmKIg63H1WdeXQ6IvnqsAu81HFA9Fi0I8tDtUxERuEahgr1WlVft3vV5 PSZSCEQKnsCkjZ/+ZVdyRmNgcexnRuTjXz7BGv92joojYme8opJZLjDFf nF3szXyggSnavqdeHgIC3DWFATb4Qvc/0F44g+h6vdt2tzrqYbDmnM1vj w==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="343750132" X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="343750132" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 08:37:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="733223908" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 29 Jun 2022 08:37:24 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 29 Jun 2022 08:37:24 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 29 Jun 2022 08:37:24 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 29 Jun 2022 08:37:24 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 29 Jun 2022 08:37:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V3TygDXBnYR9eiPlMA+pnohu/YiYq33SpRrDJpLhAXSyGCMvPQTKfbTBpBJLLJhQgxO/ntqDsZ9uxXUecVEda3eeU0FN2+JyxV8GfgVXAgEvTdqojCjxbkLXGV+03x9VZpN2IPuOSXdDGnb7aFxGowGs8vHP4Dz1+nhCEtTgbkJQKvj9JuSgwWJXy8pXmYKhrNDPZ++SRoWfo3JihLzDQGUiwMNHxKqYxe1hFxfrVzpl2vb3/vEDJeRIhON6a8yei0EfS9SGWk+BsDk/7AzJegjrs5abieFyUv4jlAnTuL97Eqi4vKka9D0RnCUDLDNIaGZAZHmrelIaO0SG603k1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qS4UedLwCwoLJ5k3rkqsaphpQhEvJ5jEx9RfQwe5pPY=; b=g0Ld8rCEDOoIT+TLO82hh3nktULmvRKmgdZs9FojLM9PWRWgCUxk7895CjZ32u3ztfUGHxqdVqiHkO7xaKshk2jfwJ/rpWq9x6T2Tx+jC0UGZBlIEy5y/vSn1DZ3e382dI9cXPByTVfyjpZdcq1kGUenBqE8yM36y56oa+B2xtZu2EDP6ogQOuuwcolovEijSZqHqm0mku1BZxlblxu8xM4/zchKJ5/WC0uQeekbDsRl3GMAml8wkF/a+PulXzwZQnCeNie31sfcsxETz8yRlrdW7ssw+JBwT/+jIJq9s0Kt/vznSebwcsYun0YBe73tHVqX0q71is537gxqPt4eMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5660.namprd11.prod.outlook.com (2603:10b6:510:d5::6) by MWHPR11MB1742.namprd11.prod.outlook.com (2603:10b6:300:113::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Wed, 29 Jun 2022 15:37:11 +0000 Received: from PH0PR11MB5660.namprd11.prod.outlook.com ([fe80::500e:af6e:6d57:1eb3]) by PH0PR11MB5660.namprd11.prod.outlook.com ([fe80::500e:af6e:6d57:1eb3%9]) with mapi id 15.20.5395.014; Wed, 29 Jun 2022 15:37:11 +0000 Message-ID: Date: Wed, 29 Jun 2022 16:37:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] app/testpmd: fix memory leak for dscp table Content-Language: en-US To: Jasvinder Singh , CC: , , References: <20220628132916.1284235-1-jasvinder.singh@intel.com> From: "Morrissey, Sean" In-Reply-To: <20220628132916.1284235-1-jasvinder.singh@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB9PR01CA0024.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::29) To PH0PR11MB5660.namprd11.prod.outlook.com (2603:10b6:510:d5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc2f0c7f-506e-4e68-810d-08da59e53b5c X-MS-TrafficTypeDiagnostic: MWHPR11MB1742:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bwTBkfxEWRFvXEobaRiR2gU32mkjSeoXM+gPWL7Mn9+QcYmNHtbKsbpolOxN/EQz2mZVhA1SGlg//t2euBz8O9I4ujPW5WSWn7r0Xvlf78bgGgn8hepeHYwWs1on6Som5/7FOmwqEm5vHbgZhYNgrAsnaTf0R+8nIpB9+hDLSumzEYBkyxcSCV88ZDkPzC9Zcx1/4gWt1ojrTTMCAFwP85x6IQNyrKGXD5t5T/FLTj/U/syJkW0Vwziutr/RCUIgNhT7TT3D22+hqvTrmqK9Av9g/sQ/MsWn6xTzEYdn3jyYm7wVZw45rGK+8tA4dcsw8zqWRmxksLxD4TA9njTxRhzMkG3Xc2FA6H4VLXkuBnyPuLukWmDLFjD+OlM13GUUCv/bVBnT9kcTbnmmfXApmui6iXzatPCPw6CDtsCFqmTTLukJg6kRgBTeSpZdnwdqur8IN9MqiNSIBhw905rabbg9JSEdu+MAJEzdh+fCIkq6DxphG01iK4g9XcbFxnMzSYtDGrCl63MAvo8CLcM5QzUznh5Mmsxs4XGV9kAtacwhLhZkv40vc6Mab5saMjXmVBvU4Gz4JyLAs925961xng4VJGwoqBBtLLLkM94vHX0363JjdcWQTJO3jJnXlxX5+wGHK/Ee6naKj4/jdRqLEcnR9LNf6N3mYd6mKlQHwUfm0ZDpdBkJ8/fRfU7zPM9RVEK765I+0OWZQbhkBNMkV88GZkj49nXKmGSHWWNBU51j33ho7LL8L3gEwe9jYxd8mAOSxf8XtusKtinaCj+pdjq5fz6HOa5YcevkwMKUlAABkCVsAPxsHdcB+5QvWXlf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5660.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(396003)(376002)(136003)(346002)(366004)(53546011)(316002)(26005)(8676002)(86362001)(478600001)(83380400001)(450100002)(6512007)(6666004)(41300700001)(82960400001)(2616005)(6486002)(4326008)(31696002)(38100700002)(5660300002)(186003)(36756003)(31686004)(2906002)(66476007)(8936002)(66556008)(66946007)(6506007)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZldSYjZGaFRya1NsWkl0TzFXdUp6ajBoaEpEb1ExU3Q1SW5MTEc0akRRYXBV?= =?utf-8?B?WFBhcCtTcTFrakM4c2ZSU3ZGM1hHV05idisyRFRidE5Lb0FrSHhrb0pnUWdU?= =?utf-8?B?VHdLVzlrWGMrUzFCLzNWYnE2aHp2WHB0aGtQd3dGUHJVM21qYWt3NmR1QnpL?= =?utf-8?B?OGxNYlJ0bWl5WVNhYlR2RXpVQTlOS2VSMjR4UmxFTkhMMy9DMDhOYVRJWkVk?= =?utf-8?B?SFJCMGFRMHp2WmRIS0swQy8yNHJSWW5jcFZzSGZDcDM3b0N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hclVtZXdnQWhiTUtVTzRjL3dkb0VKS0FpSXRseEEzNmJWTHhkRkV4RnhC?= =?utf-8?B?V3VDSkNvMk9Od1BsT1gvMHJnWS9IZ0RFQng1YXJvUW9ERVVtcGxCTnZTRVVY?= =?utf-8?B?N3c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: dc2f0c7f-506e-4e68-810d-08da59e53b5c X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5660.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2022 15:37:11.0033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Wr16LsfVTJfz9QP0oaD61uh7fpEUmepHvbVR+hyxyqmB2aLOaMbeiinA3FsLGoqhGhCT453LKaH+K1JXevryXVP79Z2wSOAX/1YUwga9rI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1742 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Reviewed-by: Sean Morrissey Thanks. On 28/06/2022 14:29, Jasvinder Singh wrote: > This patch fixes memory leak reported by coverity. > > Coverity issue: 379220 > Fixes: 9f5488e326d3 ("app/testpmd: support different input color method") > > Cc: stable@dpdk.org > > Signed-off-by: Jasvinder Singh > --- > app/test-pmd/cmdline_mtr.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c > index b92e66cedb..833273da0d 100644 > --- a/app/test-pmd/cmdline_mtr.c > +++ b/app/test-pmd/cmdline_mtr.c > @@ -131,8 +131,10 @@ parse_input_color_table_entries(char *str, enum rte_color **dscp_table, > /* Allocate memory for vlan table */ > vlan = (enum rte_color *)malloc(MAX_VLAN_TABLE_ENTRIES * > sizeof(enum rte_color)); > - if (vlan == NULL) > + if (vlan == NULL) { > + free(*dscp_table); > return -1; > + } > > i = 0; > while (1) { > @@ -144,6 +146,7 @@ parse_input_color_table_entries(char *str, enum rte_color **dscp_table, > vlan[i++] = RTE_COLOR_RED; > else { > free(vlan); > + free(*dscp_table); > return -1; > } > if (i == MAX_VLAN_TABLE_ENTRIES) > @@ -152,6 +155,7 @@ parse_input_color_table_entries(char *str, enum rte_color **dscp_table, > token = strtok_r(str, PARSE_DELIMITER, &str); > if (token == NULL) { > free(vlan); > + free(*dscp_table); > return -1; > } > }