Skip to content

commit-graph: fix memory leak when not writing graph

Patrick Steinhardt requested to merge pks-commit-graph-write-memory-leak into master

When write_commit_graph() bails out writing a split commit-graph early then it may happen that we have already gathered the set of existing commit-graph file names without yet determining the new merged set of files. This can result in a memory leak though because we only clear the preimage of files when we have collected the postimage.

Fix this issue by dropping the condition altogether so that we always try to free both preimage and postimage filenames.

Signed-off-by: Patrick Steinhardt ps@pks.im

Merge request reports