From d05c2dcc490e819e3502c6c89de22851f4fff053 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Sat, 23 Oct 2021 20:17:55 +0800 Subject: [PATCH] test/devargs: fix memory leak In layer argument test function, kvargs are parsed and checked without free. This patch calls rte_kvargs_free() function to avoid memory leak. Coverity issue: 373631 Fixes: a4975cd20dca ("test: add devargs test cases") Signed-off-by: Xueming Li Reviewed-by: David Marchand --- 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 19036716bf..16621285d2 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.39.5