]> git.ipfire.org Git - thirdparty/git.git/commit
bundle.c: don't leak the "args" in the "struct child_process"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:37 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:36 +0000 (15:34 -0800)
commit53537c6c17737010b7090634257b6274347bdbc8
tree3a3727547d6c9bcad7dac3b709e29b6f6d284264
parentb2e5d75d17c6ba13dc5966692c8ed9c105b4e13a
bundle.c: don't leak the "args" in the "struct child_process"

Fix a leak that's been here since 7366096de9d (bundle API: change
"flags" to be "extra_index_pack_args", 2021-09-05). If we can't verify
the bundle, we didn't call child_process_clear() to clear the "args".

But rather than adding an additional child_process_clear() call, let's
verify the bundle before we start preparing the process we're going to
spawn. If we fail to verify, we don't need to push anything to the
child_process "args".

Helped-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle.c