Skip to contentSkip to conversation

libbpf: fix memory leak in strset

PATCH Applied [email protected] 3 participants 3 messages Oct 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: fix memory leak in strset

From: Andrii Nakryiko <[email protected]>

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
#2 lore raw
In reply to [email protected]
This patch was applied to bpf/bpf.git (refs/heads/master):

Hello:

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

Quoted 8 lines · On Fri, 1 Oct 2021 11:59:10 -0700 you wrote:

From: Andrii Nakryiko <[email protected]>

Free struct strset itself, not just its internal parts.

Fixes 90d76d3ececc ("libbpf: Extract internal set-of-strings datastructure APIs")

[...]

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