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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a69d120c07
commit
d607bd8816
1
scalar.c
1
scalar.c
@ -732,6 +732,7 @@ static int cmd_reconfigure(int argc, const char **argv)
|
||||
succeeded = 1;
|
||||
|
||||
the_repository = old_repo;
|
||||
repo_clear(&r);
|
||||
|
||||
loop_end:
|
||||
if (!succeeded) {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
test_description='test the `scalar` command'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
test_description='test the `scalar clone` subcommand'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "${TEST_DIRECTORY}/lib-terminal.sh"
|
||||
|
||||
|
Reference in New Issue
Block a user