Commit 063c1beddf228ca8de0908dfc24c5a045de41ab3

Stefan Sperling 2018-07-23T10:12:37

free parent ids when freeing commit graph nodes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index cf6e2f6..3f3c93d 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -499,6 +499,11 @@ free_graph_node(struct got_object_id *id, void *data, void *arg)
 		SIMPLEQ_REMOVE_HEAD(&node->child_ids, entry);
 		free(child);
 	}
+	while (!SIMPLEQ_EMPTY(&node->parent_ids)) {
+		struct got_object_qid *pid = SIMPLEQ_FIRST(&node->parent_ids);
+		SIMPLEQ_REMOVE_HEAD(&node->parent_ids, entry);
+		free(pid);
+	}
 	free(node);
 }