[PATCH 3/4] test/malloc: fix missing free

Ruifeng Wang ruifeng.wang at arm.com
Fri May 19 06:29:22 CEST 2023


Free the allocated buffer before returning.

Fixes: a40a1f8231b4 ("app: various tests update")
Cc: stable at dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang at arm.com>
Reviewed-by: Feifei Wang <feifei.wang2 at arm.com>
---
 app/test/test_malloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e50611..f144b89d88 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -937,6 +937,7 @@ test_alloc_single_socket(int32_t socket)
 	if (mem == NULL)
 		return -1;
 	if (addr_to_socket(mem) != desired_socket) {
+		rte_free(mem);
 		return -1;
 	}
 	rte_free(mem);
-- 
2.25.1



More information about the stable mailing list