Commit 246e1c78b7c0d1b05a03e5801ffd25d90014f4a4

Stefan Sperling 2018-11-08T19:09:27

prevent free of bogus pointers via fetch_commits_from_open_branches()

1
2
3
4
5
6
7
8
9
10
11
12
13
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;