diff mbox series

[1/2] commit-graph: free `struct packed_git` after closing it

Message ID 84a5957ab8a38ac18c432843a3717c0afd0fbea9.1538579441.git.martin.agren@gmail.com (mailing list archive)
State New, archived
Headers show
Series commit-graph: more leak fixes | expand

Commit Message

Martin Ågren Oct. 3, 2018, 3:36 p.m. UTC
`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 mbox series

Patch

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);