tr2: stop leaking "thread_name" memory

Fix a memory leak introduced in ee4512ed48 (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>
pull/1094/head
Ævar Arnfjörð Bjarmason 1 year ago committed by Junio C Hamano
parent f2cc8881d7
commit 48f68715b1
  1. 1
      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);
}

Loading…
Cancel
Save