]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: fix a leak in module_add()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 31 Aug 2022 23:14:20 +0000 (01:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Sep 2022 16:18:13 +0000 (09:18 -0700)
commit623bd7d154daf93e910414bfc8b3080c7269f2a6
treefcb8744873b8c9a30c0c8d61ee76a42d26cec718
parent4e83605d38e30ba56878c121443695cb7eef0f56
submodule--helper: fix a leak in module_add()

Fix a leak in module_path(), since a6226fd772b (submodule--helper:
convert the bulk of cmd_add() to C, 2021-08-10), we've been freeing
add_data.sm_path, but in this case we clobbered it, and didn't free
the value we clobbered.

This makes test 28 of "t/t7400-submodule-basic.sh" ("submodule add in
subdirectory") pass when we're compiled with SANITIZE=leak..

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c