summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-08-27 10:02:15 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-07 11:07:59 -0700
commit48f68715b14b47395a5cd63568a9a29beea8aa6f (patch)
treebdafdfffb48e690769d0c648dab65478963034e1
parenttr2: clarify TRACE2_PROCESS_INFO_EXIT comment under Linux (diff)
downloadtgif-48f68715b14b47395a5cd63568a9a29beea8aa6f.tar.xz
tr2: stop leaking "thread_name" memory
Fix a memory leak introduced in ee4512ed481 (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 <avarab@gmail.com> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--trace2/tr2_tls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/trace2/tr2_tls.c b/trace2/tr2_tls.c
index 067c23755f..7da94aba52 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);
}