All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] libbpf: fix memory leak in strset
@ 2021-10-01 18:59 andrii.nakryiko
  2021-10-01 19:27 ` Martin KaFai Lau
  2021-10-01 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: andrii.nakryiko @ 2021-10-01 18:59 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team

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(+)

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)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf] libbpf: fix memory leak in strset
  2021-10-01 18:59 [PATCH bpf] libbpf: fix memory leak in strset andrii.nakryiko
@ 2021-10-01 19:27 ` Martin KaFai Lau
  2021-10-01 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: Martin KaFai Lau @ 2021-10-01 19:27 UTC (permalink / raw)
  To: andrii.nakryiko; +Cc: bpf, ast, daniel, andrii, kernel-team

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf] libbpf: fix memory leak in strset
  2021-10-01 18:59 [PATCH bpf] libbpf: fix memory leak in strset andrii.nakryiko
  2021-10-01 19:27 ` Martin KaFai Lau
@ 2021-10-01 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-01 21:00 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: bpf, ast, daniel, andrii, kernel-team

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH bpf] libbpf: fix memory leak in strset
@ 2021-10-01 18:07 Andrii Nakryiko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2021-10-01 18:07 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team

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(+)

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)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-13  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 18:59 [PATCH bpf] libbpf: fix memory leak in strset andrii.nakryiko
2021-10-01 19:27 ` Martin KaFai Lau
2021-10-01 21:00 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-10-01 18:07 Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.