From 4777674c4428f528fa2890d8afab551f6dd54c24 Mon Sep 17 00:00:00 2001 From: Conor Walsh Date: Wed, 1 Sep 2021 09:38:47 +0000 Subject: [PATCH 1/1] eal: fix memory leak when saving arguments 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 6ecf5fd660..eaef57312f 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -223,9 +223,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 */ -- 2.20.1