summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-27 13:59:07 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-27 13:59:08 -0700
commitb6fa7fbcd1b6791675c0b36636745e467419a522 (patch)
tree55c0002096f64cafa5767cf78cf7c2898b18f10f /commit-graph.c
parent6261489cdba61715ee9e0716d7a8a7fc63c53e49 (diff)
parentbeccbddb6802c0b56e34bb1d55cecceb093940f4 (diff)
Merge branch 'ly/commit-graph-fill-oids-leakfix'
Leakfix. * ly/commit-graph-fill-oids-leakfix: commit-graph: fix memory leak when `fill_oids_from_packs()` fails
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 4a6e34f8a0..bb77d81861 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1929,6 +1929,8 @@ static int fill_oids_from_packs(struct write_commit_graph_context *ctx,
}
if (open_pack_index(p)) {
ret = error(_("error opening index for %s"), packname.buf);
+ close_pack(p);
+ free(p);
goto cleanup;
}
for_each_object_in_pack(p, add_packed_commits, ctx,