Commit Diff


commit - a342f20d993be3c2a46b1440970ca7b52ec776f3
commit + 88cdb9c6444cbef8eecf1552d3f292b4448a4395
blob - 81fcd46a670afd4d0f33f51b8d0ecec2ddb2db26
blob + c25942999ae0962cb43c4da8b0fabe0d558677b8
--- lib/commit_graph.c
+++ lib/commit_graph.c
@@ -352,6 +352,8 @@ got_commit_graph_open(struct got_commit_graph **graph,
 	*graph = calloc(1, sizeof(**graph));
 	if (*graph == NULL)
 		return got_error_from_errno("calloc");
+
+	TAILQ_INIT(&(*graph)->iter_list);
 
 	(*graph)->path = strdup(path);
 	if ((*graph)->path == NULL) {
@@ -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: