summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-01-10 22:01:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-10 22:01:25 (GMT)
commit4cc676c46cf07d0302d36e4aea9ecf847510383e (patch)
tree665849530520ba75697104cbb09ebb330988bea1 /bisect.c
parentbc4efaf10306f23600649d4988eac0d4b2e216b7 (diff)
parent2e9fdc795cb27725e6dda7f4ba78ec0d9553b36a (diff)
downloadgit-4cc676c46cf07d0302d36e4aea9ecf847510383e.zip
git-4cc676c46cf07d0302d36e4aea9ecf847510383e.tar.gz
git-4cc676c46cf07d0302d36e4aea9ecf847510383e.tar.bz2
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
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bisect.c b/bisect.c
index 0fca17c..2f3008b 100644
--- a/bisect.c
+++ b/bisect.c
@@ -229,8 +229,10 @@ static struct commit_list *best_bisection_sorted(struct commit_list *list, int n
if (i < cnt - 1)
p = p->next;
}
- free_commit_list(p->next);
- p->next = NULL;
+ if (p) {
+ free_commit_list(p->next);
+ p->next = NULL;
+ }
strbuf_release(&buf);
free(array);
return list;