From: Xueming Li Date: Sat, 23 Oct 2021 12:17:55 +0000 (+0800) Subject: test/devargs: fix memory leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d05c2dcc490e819e3502c6c89de22851f4fff053;p=dpdk.git 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 --- 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; }