Skip to content

Commit 4cc676c

Browse files
committed
Merge branch 'ma/bisect-leakfix'
A hotfix for a recent update that broke 'git bisect'. * ma/bisect-leakfix: bisect: fix a regression causing a segfault
2 parents bc4efaf + 2e9fdc7 commit 4cc676c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bisect.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ static struct commit_list *best_bisection_sorted(struct commit_list *list, int n
229229
if (i < cnt - 1)
230230
p = p->next;
231231
}
232-
free_commit_list(p->next);
233-
p->next = NULL;
232+
if (p) {
233+
free_commit_list(p->next);
234+
p->next = NULL;
235+
}
234236
strbuf_release(&buf);
235237
free(array);
236238
return list;

0 commit comments

Comments
 (0)