Skip to content

Commit a69d120

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a48fc1 commit a69d120

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

read-cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,6 +3124,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
31243124
if (f)
31253125
free_hashfile(f);
31263126
strbuf_release(&sb);
3127+
free(eoie_c);
31273128
free(ieot);
31283129
return ret;
31293130
}

0 commit comments

Comments
 (0)