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 6063241D79; Mon, 13 Mar 2023 11:21:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B452406BC; Mon, 13 Mar 2023 11:21:44 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id F2A2240151; Mon, 13 Mar 2023 11:21:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678702902; x=1710238902; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tPW9xMFx/9Bo7HPVZRrD8ulpcFXA6juqL800SBKq2l8=; b=Wbp5NaIqlvj8stlkWXZjACDr1Q28zo649bfPME6mneR298yyDbAxU1zz qQSyajkr+YC/6h1YYSa7wK+XENdSsM2kxmt7zErmyYjaUCRc4+zRaHB3K b2QqC7VQnFSo38HQzhd3qLdUed38JrmFF/VmWGNLGO2pcXnmaNjQSZ6ka 6x5LNpWVz1C+Kyy8QKegfIlT0KEVjOFN2yPSeoE/yN2JI9c1ny2F0XtZO w/xwH2upgZsA7TczQS6yx1Kf5sgwiDU0oK5vf3WF7fVEPLYgwgjK3gq1N lEbV+rkWDQsDEaQr58n/EKjidyzDv22rtr22/WWQNR7+hMPsyThaG0ytK g==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="335810987" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="335810987" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 03:21:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="1007936302" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="1007936302" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 13 Mar 2023 03:21:41 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 03:21:40 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 13 Mar 2023 03:21:40 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 13 Mar 2023 03:21:40 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Mon, 13 Mar 2023 03:21:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mS/JqCOlqxOxQf6xWl0awxE71Raf0rAS1YiATy8UtMQCka2mTt5ePPfXTY8ynmCVbsAgmskZcz8mmZnk2nt09592g+7B1PXjokgkVnYk1519wcPci5yJu5lPYOydN0MCaz0VSESHSsMsq2HPAhKHw70kcFd8+DPAz9bGBaRuqAakxS92x+QDdn8VjF/wak48jjOweq+PKZbmwPIek9AU/sIThGIq0bprTPxHoCa29Nd/vxTEJIY+1IavyAi1LjFFE8M/qs8nSuTmfpuFUydaAOPXCp2Z8yvJ34qUSyBefgJ8BnK5TzV1xIbLFAvSKYj0bpDn/rjBwoMRfi0QrqQIyg== 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=JWeOoJKZ460LC+13KGLfFZMUIXiYgjaxFBlSb5+/nuI=; b=AqEH+rY7463t12QWf8NFogbJZuWFt8JTiFWgvoiC7iWjnCL/m32uG1yVRfKjt9rDV+gzQ2h/Jf3n6jZBH8pu3LSGkvQ2/j3E2USVWFYQELJMm4G0+4mImuES8td5e6gKNcjSFLragA5n7fRvEMkVx8shC5XLJpGt+nttMz1otWeLK3T1a7r2baVg24hQODwrqLO7nXHo+bXsFU6LPbG7tItxsD4uH2mGAhiPqFnBUgB/fMoB07XWrzRJmizn0cu8ZWAfSWy/i3x5/uqQyVlaIhxr1pfl3y3yK/YuR8v3dPtOyJUIv6X4uymSDWNbt+Q1HfUO6To6X9xlxgCYgAECEw== 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 Received: from SN6PR11MB3408.namprd11.prod.outlook.com (2603:10b6:805:bc::22) by CY8PR11MB7106.namprd11.prod.outlook.com (2603:10b6:930:52::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 10:21:34 +0000 Received: from SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::651a:1bea:27fd:f02d]) by SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::651a:1bea:27fd:f02d%4]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 10:21:34 +0000 From: "Ji, Kai" To: "Power, Ciara" , "dev@dpdk.org" CC: "stable@dpdk.org" Subject: RE: [PATCH] app/crypto-perf: fix test file memory leak Thread-Topic: [PATCH] app/crypto-perf: fix test file memory leak Thread-Index: AQHZU1MUslKY4bvvT0CiTRd6IgydYK74hGqA Date: Mon, 13 Mar 2023 10:21:34 +0000 Message-ID: References: <20230310132017.6900-1-ciara.power@intel.com> In-Reply-To: <20230310132017.6900-1-ciara.power@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3408:EE_|CY8PR11MB7106:EE_ x-ms-office365-filtering-correlation-id: 1ebac198-c52f-4e0c-8221-08db23acb8b0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OM6G9imuRUeBVHY4earFdYJuhmHlrig/S5vbHCvSnsp3koA2KmbIY7Yzqa0bBBnC2yP8wGnJJIaMus4sIlv4vmA0rs5iaSFkJVdYP0Dlo3YH1MqrBkt5SxNGfHBDMj9urpCCuecow5cJpZrWMPhhXBa6W2p2ulMgGjdUgMLQiMYsyjvaclX9LIzhAgGY+EWFH2ppckujOb8/Jv/RfjXYt3I4ygLBV5AQhXRElZnCBV/mVYcyBcQxge3nHTO7hMImYXoBSPlTz+VVniIjNtYLEstOrxFWjhzMczUDG3Wj7mumksKyp/ZOvz5LpORlIoNafsKsoQ81YEBE2Ox9aftX5md6x+LBqHbMziYSq2Dmq6WAfoNoPkVnAQ5Vyzg2OPa7R7DkyCkv39kkcnahUFMegdB2YQjj29UUtEW/6vn9WGF8h0dPwGHtn5JjNO2F0ROhmLN7gPolP9N7HUNekUEXMAhoEwn0rL1JsjnSevZ9+3vO0njy22SQfV7A/EDue2FUWYFAOXndzaezcVr+lrpUUgk3NEgIOjGVPrGhqLtkAnfRS1jNZISG2tdLT8Y9X9TaPqWbAZ6diBLm8kAbHqpNTKyZToO7SlqWY6H3+fT62qx5MKnwdjaMOk7PRHzrBdb5uQvSkE7MgyatAJAhhHyvEQpk0eZHqBABV9y+1mcRhRUNOC47a2qUPoDt1EoEys4t7jjYCyYXG6iJl44CVKn8sw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3408.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199018)(2906002)(82960400001)(122000001)(83380400001)(5660300002)(55016003)(33656002)(52536014)(66946007)(76116006)(66556008)(41300700001)(8936002)(66476007)(66446008)(64756008)(4326008)(450100002)(38070700005)(316002)(38100700002)(86362001)(8676002)(110136005)(478600001)(7696005)(186003)(53546011)(26005)(6506007)(71200400001)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hsdVr+4Ov7gJ4J7PoY+Zevy4mow/61F6EWWNj58Eb72XUzRCNorvadLxewH3?= =?us-ascii?Q?rSmjhH2c7mfCJsfqZDixD0kcIpfu4mweHlIknXFmww0783VVW/R2ffNOi+bE?= =?us-ascii?Q?06PmYbN3y+GpcDyUS1GQ2IsnKW1PHM0mQm4hKiCBrSYaXg63fIwpfTTgu1IM?= =?us-ascii?Q?Wy1oNsI/JxMzRMcG77ONpqMdPQQG6mww4lLl/6HUec10+XpkgLHHLYeQl3A4?= =?us-ascii?Q?tSXAU0DTINgBw17/ECGT0qHAKkNqvmvsZyKn/XkKoO9r6e82gjQDKLah6ka1?= =?us-ascii?Q?Ux9ICzeWlS2Wo1pJq8ax43bKRvFQlMhMdZS7D9XTgvktFLHC2d8hPZAkwq7X?= =?us-ascii?Q?+vdy7j0/vQZ+LMV1yob7K7VCc/7M3IkT/kzLzSL9r7h7pAtn13ADwYNbvmi5?= =?us-ascii?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c6Y5RHjpJUnF?= =?us-ascii?Q?IGuCFSDkIH0IfJbsbE2PEqM3IEUe6RzM/B25HoyHLJZZvi/ZowXFH357daY6?= =?us-ascii?Q?D2J/wP7vTiPxuHvcbXMit6IaXdKJ9qfUv7iQ+A1f+/Ez1aW60RhXnNdHwVRP?= =?us-ascii?Q?zqu6Fk2ZV6gWP/iUp/wBPgFY2krhBstYogWez3WUPh4560tIOlNtA/ZlbAnt?= =?us-ascii?Q?8bclH7oPpPsInO1G5UsDHzIdMaTeCWTO6QfJVyWBBZG4P7kNuo+LVrM0/RME?= =?us-ascii?Q?Mzyeti2E0O0j9f26GmM=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3408.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ebac198-c52f-4e0c-8221-08db23acb8b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2023 10:21:34.2667 (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: vjJGjwfvzckryaFfSlrutFUGpQI7sVYHkmqJdBMFswT0lIQN7wzyGelMAHY0eyCV/p+IQmtkUYhUvwzX5pZ/Nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7106 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 Acked-by: Kai Ji > -----Original Message----- > From: Power, Ciara > Sent: Friday, March 10, 2023 1:20 PM > To: dev@dpdk.org > Cc: Ji, Kai ; Power, Ciara ; > stable@dpdk.org > Subject: [PATCH] app/crypto-perf: fix test file memory leak >=20 > A memory leak was detected using the AddressSanitizer tool, when running > the crypto-perf application with a test vector file. >=20 > The strdup function used returns a pointer to a null-terminated byte > string, which must be freed after use. This patch frees the pointer in an > error case, and also after a successful run. >=20 > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test > application") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ciara Power > --- > app/test-crypto-perf/cperf_options_parsing.c | 1 + > app/test-crypto-perf/cperf_test_vector_parsing.c | 1 + > 2 files changed, 2 insertions(+) >=20 > diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test- > crypto-perf/cperf_options_parsing.c > index 8c9f632590..26136a52ae 100644 > --- a/app/test-crypto-perf/cperf_options_parsing.c > +++ b/app/test-crypto-perf/cperf_options_parsing.c > @@ -519,6 +519,7 @@ parse_test_file(struct cperf_options *opts, > if (access(opts->test_file, F_OK) !=3D -1) > return 0; > RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n"); > + free(opts->test_file); >=20 > return -1; > } > diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test- > crypto-perf/cperf_test_vector_parsing.c > index 98e46c3381..737d61d4af 100644 > --- a/app/test-crypto-perf/cperf_test_vector_parsing.c > +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c > @@ -30,6 +30,7 @@ free_test_vector(struct cperf_test_vector *vector, > struct cperf_options *opts) > rte_free(vector->cipher_key.data); > rte_free(vector->auth_key.data); > rte_free(vector->ciphertext.data); > + free(opts->test_file); > } >=20 > rte_free(vector); > -- > 2.25.1