Skip to content

Commit 48f6871

Browse files
avargitster
authored andcommitted
tr2: stop leaking "thread_name" memory
Fix a memory leak introduced in ee4512e (trace2: create new combined trace facility, 2019-02-22), we were doing a free() of other memory allocated in tr2tls_create_self(), but not the "thread_name" "struct strbuf". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2cc888 commit 48f6871

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

trace2/tr2_tls.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void tr2tls_unset_self(void)
9595

9696
pthread_setspecific(tr2tls_key, NULL);
9797

98+
strbuf_release(&ctx->thread_name);
9899
free(ctx->array_us_start);
99100
free(ctx);
100101
}

0 commit comments

Comments
 (0)