From: Ævar Arnfjörð Bjarmason Date: Thu, 3 Feb 2022 21:40:11 +0000 (+0100) Subject: leak tests: fix a memory leak in "test-progress" helper X-Git-Tag: v2.36.0-rc0~113^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8266e0c02973618f68b45957a2dcb29660737486;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/helper/test-progress.c b/t/helper/test-progress.c index 5d05cbe789..9265e6ab7c 100644 --- a/t/helper/test-progress.c +++ b/t/helper/test-progress.c @@ -69,6 +69,7 @@ int cmd__progress(int argc, const char **argv) die("invalid input: '%s'\n", line.buf); } stop_progress(&progress); + strbuf_release(&line); return 0; } diff --git a/t/t0500-progress-display.sh b/t/t0500-progress-display.sh index 22058b503a..f37cf2eb9c 100755 --- a/t/t0500-progress-display.sh +++ b/t/t0500-progress-display.sh @@ -2,6 +2,7 @@ test_description='progress display' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh show_cr () {