read-cache: fix leaking hash context in do_write_index()

When writing an index with the EOIE extension we allocate a separate
hash context. We never free that context though, causing a memory leak.
Plug it.

This leak is exposed by t9210, but plugging it alone does not make the
whole test suite pass.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-09-30 11:13:13 +02:00
committed by Junio C Hamano
parent 9a48fc1da2
commit a69d120c07

View File

@ -3124,6 +3124,7 @@ out:
if (f)
free_hashfile(f);
strbuf_release(&sb);
free(eoie_c);
free(ieot);
return ret;
}