merge-base: free() allocated "struct commit **" list
commite69fe2e460080771e1de43f2e8b76adda2252c5f
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 4 Mar 2022 18:32:05 +0000 (4 19:32 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Mar 2022 21:24:17 +0000 (4 13:24 -0800)
tree5226e6e2dc81e8c958f0c9b7a82bfba65d33e851
parentf2bcc69e7ecbd80fe1de81a196c97173f33785b5
merge-base: free() allocated "struct commit **" list

Fix a memory leak in 53eda89b2fe (merge-base: teach "git merge-base"
to drive underlying merge_bases_many(), 2008-07-30) by calling free()
on the "struct commit **" list used by "git merge-base".

This gets e.g. "t6010-merge-base.sh" closer to passing under
SANITIZE=leak, it failed 8 tests before when compiled with that
option, and now fails only 5 tests.

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