submodule--helper: free some "displaypath" in "struct update_data"

Make the update_data_release() function free "displaypath" member when
appropriate. The "displaypath" member is always ours, the "const" on
the "char *" was wrong to begin with.

This leaves a leak of "displaypath" in update_submodule(), which as
we'll see in subsequent commits is harder to deal with than this
trivial fix.

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>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2022-09-01 01:14:22 +02:00
committed by Junio C Hamano
parent 25b6a95d03
commit d40c42e06b
4 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ This test verifies that the set-branch subcommand of git-submodule is working
as expected.
'
TEST_PASSES_SANITIZE_LEAK=true
TEST_NO_CREATE_REPO=1
. ./test-lib.sh