Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
d607bd88 a69d120c

+3
+1
scalar.c
··· 732 succeeded = 1; 733 734 the_repository = old_repo; 735 736 loop_end: 737 if (!succeeded) {
··· 732 succeeded = 1; 733 734 the_repository = old_repo; 735 + repo_clear(&r); 736 737 loop_end: 738 if (!succeeded) {
+1
t/t9210-scalar.sh
··· 2 3 test_description='test the `scalar` command' 4 5 . ./test-lib.sh 6 7 GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
··· 2 3 test_description='test the `scalar` command' 4 5 + TEST_PASSES_SANITIZE_LEAK=true 6 . ./test-lib.sh 7 8 GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
+1
t/t9211-scalar-clone.sh
··· 2 3 test_description='test the `scalar clone` subcommand' 4 5 . ./test-lib.sh 6 . "${TEST_DIRECTORY}/lib-terminal.sh" 7
··· 2 3 test_description='test the `scalar clone` subcommand' 4 5 + TEST_PASSES_SANITIZE_LEAK=true 6 . ./test-lib.sh 7 . "${TEST_DIRECTORY}/lib-terminal.sh" 8