summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2017-11-05 20:24:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-06 01:15:29 (GMT)
commitfc5c40bb2bb1921f3bdfa55c1d846dc080c356b2 (patch)
tree77201679493967c9e2263956aa192cf81a7b0d5e /bisect.c
parent24d707f636f01d41f708a010f255dd46a8fce08c (diff)
downloadgit-fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2.zip
git-fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2.tar.gz
git-fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2.tar.bz2
bisect: fix memory leak in `find_bisection()`
`find_bisection()` rebuilds the commit list it is given by reversing it and skipping uninteresting commits. The uninteresting list entries are leaked. Free them to fix the leak. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bisect.c b/bisect.c
index 5a3ae49..2f43217 100644
--- a/bisect.c
+++ b/bisect.c
@@ -379,8 +379,10 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
unsigned flags = p->item->object.flags;
next = p->next;
- if (flags & UNINTERESTING)
+ if (flags & UNINTERESTING) {
+ free(p);
continue;
+ }
p->next = last;
last = p;
if (!(flags & TREESAME))