Skip to content

Commit b0e875b

Browse files
anakryikoborkmann
authored andcommitted
libbpf: Fix memory leak in strset
Free struct strset itself, not just its internal parts. Fixes: 90d76d3 ("libbpf: Extract internal set-of-strings datastructure APIs") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 4729445 commit b0e875b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/lib/bpf/strset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void strset__free(struct strset *set)
8888

8989
hashmap__free(set->strs_hash);
9090
free(set->strs_data);
91+
free(set);
9192
}
9293

9394
size_t strset__data_size(const struct strset *set)

0 commit comments

Comments
 (0)