aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Matov <sergey.matov@travelping.com>2020-11-23 21:35:28 +0400
committerNeale Ranns <neale@graphiant.com>2022-07-06 01:46:14 +0000
commitac199fcd9ba16a9dc3657f8ee02c2a2c82a65417 (patch)
treed415394ceac272511f64aad76cf037614417db0f
parent972dc17634e430cb93b97c67b50096acc3164231 (diff)
vppinfra: fix memory leak in sparse_vec_free()
Type: fix Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Signed-off-by: Sergey Matov <sergey.matov@travelping.com> Change-Id: I4ec1a68b7266f05ab7c543cd8207afb29e740743
-rw-r--r--src/vppinfra/sparse_vec.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vppinfra/sparse_vec.h b/src/vppinfra/sparse_vec.h
index 1f57d304e95..3bd440d5dbd 100644
--- a/src/vppinfra/sparse_vec.h
+++ b/src/vppinfra/sparse_vec.h
@@ -225,7 +225,10 @@ sparse_vec_index2 (void *v,
{ \
if (V) \
{ \
- clib_mem_free (sparse_vec_header (V)); \
+ sparse_vec_header_t *_h = sparse_vec_header (V); \
+ vec_free (_h->is_member_bitmap); \
+ vec_free (_h->member_counts); \
+ clib_mem_free (_h); \
V = 0; \
} \
} \