diff mbox series

[bpf] libbpf: fix memory leak in strset

Message ID 20211001185910.86492-1-andrii@kernel.org (mailing list archive)
State Accepted
Commit b0e875bac0fab3e7a7431c2eee36a8ccc0c712ac
Delegated to: BPF
Headers show
Series [bpf] libbpf: fix memory leak in strset | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf
netdev/subject_prefix success Link
netdev/cc_maintainers warning 6 maintainers not CCed: songliubraving@fb.com yhs@fb.com netdev@vger.kernel.org john.fastabend@gmail.com kafai@fb.com kpsingh@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
bpf/vmtest-bpf success VM_Test
bpf/vmtest-bpf-PR success PR summary

Commit Message

Andrii Nakryiko Oct. 1, 2021, 6:59 p.m. UTC
From: Andrii Nakryiko <andrii@kernel.org>

Free struct strset itself, not just its internal parts.

Fixes: 90d76d3ececc ("libbpf: Extract internal set-of-strings datastructure APIs")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/lib/bpf/strset.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin KaFai Lau Oct. 1, 2021, 7:27 p.m. UTC | #1
On Fri, Oct 01, 2021 at 11:59:10AM -0700, andrii.nakryiko@gmail.com wrote:
> From: Andrii Nakryiko <andrii@kernel.org>
> 
> Free struct strset itself, not just its internal parts.
Acked-by: Martin KaFai Lau <kafai@fb.com>
patchwork-bot+netdevbpf@kernel.org Oct. 1, 2021, 9 p.m. UTC | #2
Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Fri,  1 Oct 2021 11:59:10 -0700 you wrote:
> From: Andrii Nakryiko <andrii@kernel.org>
> 
> Free struct strset itself, not just its internal parts.
> 
> Fixes: 90d76d3ececc ("libbpf: Extract internal set-of-strings datastructure APIs")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> 
> [...]

Here is the summary with links:
  - [bpf] libbpf: fix memory leak in strset
    https://git.kernel.org/bpf/bpf/c/b0e875bac0fa

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

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)