Skip to content

Commit

Permalink
test/malloc: fix missing free
Browse files Browse the repository at this point in the history
[ upstream commit ec8ef136b8d9340003118bb25390d7c6989178bf ]

Free the allocated buffer before returning.

Fixes: a40a1f8 ("app: various tests update")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
Ruifeng Wang authored and kevintraynor committed Jul 11, 2023
1 parent e531825 commit 13c7286
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/test/test_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,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);
Expand Down

0 comments on commit 13c7286

Please sign in to comment.