patch 'examples/qos_sched: fix memory leak in args parsing' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:46:21 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=88f1c9af336f8fee966bd4b4b5f26e54ff809270

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 88f1c9af336f8fee966bd4b4b5f26e54ff809270 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Fri, 10 Nov 2023 10:01:16 +0000
Subject: [PATCH] examples/qos_sched: fix memory leak in args parsing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]

Should free the memory which allocated by strdup().

Fixes: 035b6a4f4bba ("examples/qos_sched: fix out-of-bounds option parsing")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 examples/qos_sched/args.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index e97273152a..8d61d3e454 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -103,8 +103,10 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32

 	n_tokens = rte_strsplit(string, strnlen(string, 32), tokens, n_vals, separator);

-	if (n_tokens > MAX_OPT_VALUES)
+	if (n_tokens > MAX_OPT_VALUES) {
+		free(string);
 		return -1;
+	}

 	for (i = 0; i < n_tokens; i++)
 		opt_vals[i] = (uint32_t)atol(tokens[i]);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.248213842 +0800
+++ 0040-examples-qos_sched-fix-memory-leak-in-args-parsing.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From db8aee153e43375538667c6f861e981a47574476 Mon Sep 17 00:00:00 2001
+From 88f1c9af336f8fee966bd4b4b5f26e54ff809270 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list