Skip to content

Commit f1652c0

Browse files
pks-tgitster
authored andcommitted
t/helper: fix leaking subrepo in nested submodule config helper
In the "submodule-nested-repo-config" helper we create a submodule repository and print its configuration. We do not clear the repo, causing a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2266bb4 commit f1652c0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

t/helper/test-submodule-nested-repo-config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ int cmd__submodule_nested_repo_config(int argc, const char **argv)
2929
print_config_from_gitmodules(&subrepo, argv[2]);
3030

3131
submodule_free(the_repository);
32-
32+
repo_clear(&subrepo);
3333
return 0;
3434
}

t/t7411-submodule-config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ from the database and from the worktree works.
1010
'
1111

1212
TEST_NO_CREATE_REPO=1
13+
TEST_PASSES_SANITIZE_LEAK=true
1314
. ./test-lib.sh
1415

1516
test_expect_success 'setup' '

0 commit comments

Comments
 (0)