]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: fix test-oid-array leak, test in SANITIZE=leak
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 7 Oct 2021 10:01:34 +0000 (12:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Oct 2021 22:40:15 +0000 (15:40 -0700)
Fix a trivial memory leak present ever since 38d905bf585 (sha1-array:
add test-sha1-array and basic tests, 2014-10-01), now that that's
fixed we can test this under GIT_TEST_PASSING_SANITIZE_LEAK=true.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-oid-array.c
t/t0064-oid-array.sh

index b16cd0b11b147559e01f4413213148a70f4cb9e1..d1324d086a24c0575e6beadaeef2ce1e8b6a80f0 100644 (file)
@@ -35,5 +35,9 @@ int cmd__oid_array(int argc, const char **argv)
                else
                        die("unknown command: %s", line.buf);
        }
+
+       strbuf_release(&line);
+       oid_array_clear(&array);
+
        return 0;
 }
index 2e5438ccdacdeb31d60d3ffab22dcbc8151134fd..88c89e8f48ac1082892734c5bdb0e73a796f74f0 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 test_description='basic tests for the oid array implementation'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 echoid () {