DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] test: fix devargs test case memory leak
@ 2021-10-23 12:17 Xueming Li
  2021-10-23 12:40 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Xueming Li @ 2021-10-23 12:17 UTC (permalink / raw)
  To: dev; +Cc: xuemingl, David Marchand, Gaetan Rivet

In layer argument test function, kvargs are parsed and checked without
free. This patch calls rte_kvargs_free() function to avoid memory leak.

Fixes: a4975cd20dca ("test: add devargs test cases")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 app/test/test_devargs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c
index 19036716bf7..16621285d2d 100644
--- a/app/test/test_devargs.c
+++ b/app/test/test_devargs.c
@@ -43,8 +43,10 @@ test_args(const char *devargs, const char *layer, const char *args, const int n)
 	if ((int)kvlist->count != n) {
 		printf("rte_devargs_parse(%s) %s_str: %s kv number %u, not %d\n",
 		       devargs, layer, args, kvlist->count, n);
+		rte_kvargs_free(kvlist);
 		return -1;
 	}
+	rte_kvargs_free(kvlist);
 	return 0;
 }
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-25  7:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23 12:17 [dpdk-dev] [PATCH v1] test: fix devargs test case memory leak Xueming Li
2021-10-23 12:40 ` David Marchand
2021-10-25  7:42   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).