Commit 88cdb9c6444cbef8eecf1552d3f292b4448a4395

Stefan Sperling 2020-01-04T18:51:14

init TAILQ earlier in got_commit_graph_open(), just in case

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index 81fcd46..c259429 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -353,6 +353,8 @@ got_commit_graph_open(struct got_commit_graph **graph,
 	if (*graph == NULL)
 		return got_error_from_errno("calloc");
 
+	TAILQ_INIT(&(*graph)->iter_list);
+
 	(*graph)->path = strdup(path);
 	if ((*graph)->path == NULL) {
 		err = got_error_from_errno("strdup");
@@ -371,7 +373,6 @@ got_commit_graph_open(struct got_commit_graph **graph,
 		goto done;
 	}
 
-	TAILQ_INIT(&(*graph)->iter_list);
 	if (first_parent_traversal)
 		(*graph)->flags |= GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL;
 done: