leak tests: fix a memory leak in "test-progress" helper
Fix a memory leak in the test-progress helper, and mark the corresponding "t0500-progress-display.sh" test as being leak-free under SANITIZE=leak. This fixes a leak added in 2bb74b53a4 (Test the progress display, 2019-09-16). My 48f68715b14 (tr2: stop leaking "thread_name" memory, 2021-08-27) had fixed another memory leak in this test (as it did some trace2 testing). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 3, 2022 at 22:40 UTC
8266e0c02973618f68b45957a2dcb29660737486
2 files changed
+2
t/helper/test-progress.c
+1
@@ -69,6 +69,7 @@ int cmd__progress(int argc, const char **argv)
69
die("invalid input: '%s'\n", line.buf);
70
}
71
stop_progress(&progress);
72
+ strbuf_release(&line);
73
74
return 0;
75
}
t/t0500-progress-display.sh
+1
@@ -2,6 +2,7 @@
2
3
test_description='progress display'
4
5
+TEST_PASSES_SANITIZE_LEAK=true
6
. ./test-lib.sh
7
8
show_cr () {