Thread (48 messages) flat view 48 messages, 8 authors, 2021-11-09
STALE1770d

[PATCH 1/7] trace2: fix memory leak of thread name

From: Jeff Hostetler via GitGitGadget <hidden>
Date: 2021-09-15 20:36:30
Subsystem: the rest · Maintainer: Linus Torvalds

From: Jeff Hostetler <redacted>

Do not leak the thread name (contained within the thread context) when
a thread terminates.

Signed-off-by: Jeff Hostetler <redacted>
---
 trace2/tr2_tls.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/trace2/tr2_tls.c b/trace2/tr2_tls.c
index 067c23755fb..7da94aba522 100644
--- a/trace2/tr2_tls.c
+++ b/trace2/tr2_tls.c
@@ -95,6 +95,7 @@ void tr2tls_unset_self(void)
 
 	pthread_setspecific(tr2tls_key, NULL);
 
+	strbuf_release(&ctx->thread_name);
 	free(ctx->array_us_start);
 	free(ctx);
 }
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help