]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/submodule--helper: fix leaking remote ref on errors
authorPatrick Steinhardt <ps@pks.im>
Thu, 26 Sep 2024 11:46:21 +0000 (13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Sep 2024 15:25:35 +0000 (08:25 -0700)
commit5bf922a4e914f15d899d38218ad0591933025ed4
treeb550eb0e0393450a0295b679d4f4e71111c8bab3
parentf1652c04b5da814a6bd15873a0a0323bf58badcf
builtin/submodule--helper: fix leaking remote ref on errors

When `update_submodule()` fails we return with `die_message()`, which
only causes us to print the same message as `die()` would without
actually causing the process to die. We don't free memory in that case
and thus leak memory.

Fix the leak by freeing the remote ref.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7420-submodule-set-url.sh