Skip to content

Commit 6ad66ab

Browse files
avargitster
authored andcommitted
tests: fix test-oid-array leak, test in SANITIZE=leak
Fix a trivial memory leak present ever since 38d905b (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 926d233 commit 6ad66ab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

t/helper/test-oid-array.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,9 @@ int cmd__oid_array(int argc, const char **argv)
3535
else
3636
die("unknown command: %s", line.buf);
3737
}
38+
39+
strbuf_release(&line);
40+
oid_array_clear(&array);
41+
3842
return 0;
3943
}

t/t0064-oid-array.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='basic tests for the oid array implementation'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57

68
echoid () {

0 commit comments

Comments
 (0)