Skip to content

Commit

Permalink
tr2: stop leaking "thread_name" memory
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
avar authored and gitster committed Sep 7, 2021
1 parent f2cc888 commit 48f6871
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions trace2/tr2_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 48f6871

Please sign in to comment.