Skip to content

Commit d607bd8

Browse files
pks-tgitster
authored andcommitted
scalar: fix leaking repositories
In the scalar code we iterate through multiple repositories, initializing each of them. We never clear them though, causing memory leaks. Plug them. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a69d120 commit d607bd8

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

scalar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ static int cmd_reconfigure(int argc, const char **argv)
732732
succeeded = 1;
733733

734734
the_repository = old_repo;
735+
repo_clear(&r);
735736

736737
loop_end:
737738
if (!succeeded) {

t/t9210-scalar.sh

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

33
test_description='test the `scalar` command'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67

78
GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"

t/t9211-scalar-clone.sh

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

33
test_description='test the `scalar clone` subcommand'
44

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

0 commit comments

Comments
 (0)