Skip to content

Commit 58888c0

Browse files
pks-tgitster
authored andcommitted
t/helper: fix leaking repository in partial-clone helper
We initialize but never clear a repository in the partial-clone test helper. Plug this leak. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6361dea commit 58888c0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

t/helper/test-partial-clone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ static void object_info(const char *gitdir, const char *oid_hex)
2626
if (oid_object_info_extended(&r, &oid, &oi, 0))
2727
die("could not obtain object info");
2828
printf("%d\n", (int) size);
29+
30+
repo_clear(&r);
2931
}
3032

3133
int cmd__partial_clone(int argc, const char **argv)

t/t0410-partial-clone.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='partial clone'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67
. "$TEST_DIRECTORY"/lib-terminal.sh
78

0 commit comments

Comments
 (0)