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>
Martin Ågren committed
Nov 5, 2017 at 21:24 UTC
fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2
1 file changed
+3
-1
bisect.c
+3
-1
@@ -379,8 +379,10 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
379
unsigned flags = p->item->object.flags;
380
381
next = p->next;
382
- if (flags & UNINTERESTING)
382
+ if (flags & UNINTERESTING) {
383
+ free(p);
384
continue;
385
+ }
386
p->next = last;
387
last = p;
388
if (!(flags & TREESAME))