aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/strset.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2021-10-01 18:59:10 +0000
committerDaniel Borkmann <[email protected]>2021-10-01 20:54:38 +0000
commitb0e875bac0fab3e7a7431c2eee36a8ccc0c712ac (patch)
treea1183b6c5ce4e6f0b520a2e5e23acd7623382084 /tools/lib/bpf/strset.c
parentlibbpf: Fix segfault in light skeleton for objects without BTF (diff)
downloadkernel-b0e875bac0fab3e7a7431c2eee36a8ccc0c712ac.tar.gz
kernel-b0e875bac0fab3e7a7431c2eee36a8ccc0c712ac.zip
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") 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]
Diffstat (limited to 'tools/lib/bpf/strset.c')
-rw-r--r--tools/lib/bpf/strset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/strset.c b/tools/lib/bpf/strset.c
index 1fb8b49de1d6..ea655318153f 100644
--- a/tools/lib/bpf/strset.c
+++ b/tools/lib/bpf/strset.c
@@ -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)