tests: fix test-oid-array leak, test in SANITIZE=leak
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>
Ævar Arnfjörð Bjarmason committed
Oct 7, 2021 at 12:01 UTC
6ad66ab45e5e23378a6abf2c1d680b4cf8b85877
2 files changed
+6
t/helper/test-oid-array.c
+4
@@ -35,5 +35,9 @@ int cmd__oid_array(int argc, const char **argv)
35
else
36
die("unknown command: %s", line.buf);
37
}
38
+
39
+ strbuf_release(&line);
40
+ oid_array_clear(&array);
41
+
42
return 0;
43
}
t/t0064-oid-array.sh
+2
@@ -1,6 +1,8 @@
1
#!/bin/sh
2
3
test_description='basic tests for the oid array implementation'
4
+
5
+TEST_PASSES_SANITIZE_LEAK=true
6
. ./test-lib.sh
7
8
echoid () {