From patchwork Wed Sep 1 09:38:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 97682 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E460A0C4D; Wed, 1 Sep 2021 11:38:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1AB740140; Wed, 1 Sep 2021 11:38:56 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id CEEC14013F for ; Wed, 1 Sep 2021 11:38:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10093"; a="198256351" X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="198256351" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2021 02:38:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="532033222" Received: from silpixa00401160.ir.intel.com ([10.55.128.248]) by FMSMGA003.fm.intel.com with ESMTP; 01 Sep 2021 02:38:50 -0700 From: Conor Walsh To: bruce.richardson@intel.com, ciara.power@intel.com, keith.wiles@intel.com Cc: dev@dpdk.org, Conor Walsh , Zhihong Peng , Conor Fogarty Date: Wed, 1 Sep 2021 09:38:47 +0000 Message-Id: <20210901093847.2269921-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] eal: fix memory leak when saving arguments 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 Sender: "dev" This patch fixes a memleak which was reported in Bugzilla within the eal_save_args function. This was caused by the function mistakenly adding -- to the eal args instead of breaking beforehand. Bugzilla ID: 722 Fixes: 293c53d8b23c ("eal: add telemetry callbacks") Reported-by: Zhihong Peng Signed-off-by: Conor Walsh Signed-off-by: Conor Fogarty Acked-by: Bruce Richardson --- lib/eal/common/eal_common_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index ff5861b5f3..bee716a714 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -229,9 +229,9 @@ eal_save_args(int argc, char **argv) return -1; for (i = 0; i < argc; i++) { - eal_args[i] = strdup(argv[i]); if (strcmp(argv[i], "--") == 0) break; + eal_args[i] = strdup(argv[i]); } eal_args[i++] = NULL; /* always finish with NULL */