]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/clone.c
clone: use free() instead of UNLEAK()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:39 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:37 +0000 (15:34 -0800)
commit81e5c39cf63b414468adcc6601184212e68e1fc1
treed970a9442f967ea662a1ca8f8cd339ae543446f7
parente8ed0a8ac5ecb4379018e78188ed3ff489c7cfc5
clone: use free() instead of UNLEAK()

Change an UNLEAK() added in 0c4542738e6 (clone: free or UNLEAK further
pointers when finished, 2021-03-14) to use a "to_free" pattern
instead. In this case the "repo" can be either this absolute_pathdup()
value, or in the "else if" branch seen in the context the the
"argv[0]" argument to "main()".

We can only free() the value in the former case, hence the "to_free"
pattern.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c