Free the allocated buffer before returning.

Fixes: a40a1f8231b4 ("app: various tests update")
Cc: sta...@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.w...@arm.com>
Reviewed-by: Feifei Wang <feifei.wa...@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

Reply via email to