prevent free of bogus pointers via fetch_commits_from_open_branches()
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index 845e5be..f663cec 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -581,7 +581,7 @@ fetch_commits_from_open_branches(int *nfetched,
*changed_id = commit_id;
}
done:
- for (i = 0; i < ntips; i++)
+ for (i = 0; i < arg.ntips; i++)
got_object_commit_close(arg.tips[i].commit);
(*nfetched) = arg.ntips;
return err;