Skip to content

Commit 926d233

Browse files
avargitster
authored andcommitted
tests: fix a memory leak in test-oidtree.c
Fix a memory leak in t/helper/test-oidtree.c, we were not freeing the "struct strbuf" we used for the stdin input we parsed. This leak has been here ever since 92d8ed8 (oidtree: a crit-bit tree for odb_loose_cache, 2021-07-07). Now that it's fixed we can declare that t0069-oidtree.sh will pass 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 c0b80e0 commit 926d233

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

t/helper/test-oidtree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ int cmd__oidtree(int argc, const char **argv)
4545
die("unknown command: %s", line.buf);
4646
}
4747
}
48+
49+
strbuf_release(&line);
50+
4851
return 0;
4952
}

t/t0069-oidtree.sh

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

33
test_description='basic tests for the oidtree implementation'
4+
TEST_PASSES_SANITIZE_LEAK=true
45
. ./test-lib.sh
56

67
maxhexsz=$(test_oid hexsz)

0 commit comments

Comments
 (0)