Skip to contentSkip to conversation

libbpf: fix memory leak in strset

PATCH New Andrii Nakryiko 1 participant 1 message Oct 13, 2021

Subsystems (2)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 libbpf: fix memory leak in strset

Free struct strset itself, not just its internal parts.

Fixes 90d76d3ececc ("libbpf: Extract internal set-of-strings datastructure APIs")
---
 tools/lib/bpf/strset.c | 1 +
 1 file changed, 1 insertion(+)
tools/lib/bpf/strset.c +1 -0
index 1fb8b49de1d6..ea655318153f 100644
@@ -88,6 +88,7 @@ void strset__free(struct strset *set)
 
 	hashmap__free(set->strs_hash);
 	free(set->strs_data);
+	free(set);
 }
 
 size_t strset__data_size(const struct strset *set)
Signature · 1 line
2.30.2