[PATCH 1/2] commit-graph: free `struct packed_git` after closing it
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Oct 3, 2018, 15:36 UTC
- Message-ID
- <84a5957ab8a38ac18c432843a3717c0afd0fbea9.1538579441.git.martin.agren@gmail.com>
- In-Reply-To
- <cover.1538579441.git.martin.agren@gmail.com>
`close_pack(p)` does not free the memory which `p` points to, so follow up with a call to `free(p)`. All other users of `close_pack()` look ok.
Signed-off-by: Martin Ågren <martin.agren@gmail.com> --- commit-graph.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/commit-graph.c b/commit-graph.c index 3d644fddc0..9b481bcd06 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -766,6 +766,7 @@ void write_commit_graph(const char *obj_dir, die(_("error opening index for %s"), packname.buf); for_each_object_in_pack(p, add_packed_commits, &oids, 0); close_pack(p); + free(p); } stop_progress(&oids.progress); strbuf_release(&packname);
-- 2.19.0.329.g76f2f5c1e3