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>
This commit is contained in:

committed by
Junio C Hamano

parent
24d707f636
commit
fc5c40bb2b
4
bisect.c
4
bisect.c
@ -379,8 +379,10 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
|
|||||||
unsigned flags = p->item->object.flags;
|
unsigned flags = p->item->object.flags;
|
||||||
|
|
||||||
next = p->next;
|
next = p->next;
|
||||||
if (flags & UNINTERESTING)
|
if (flags & UNINTERESTING) {
|
||||||
|
free(p);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
p->next = last;
|
p->next = last;
|
||||||
last = p;
|
last = p;
|
||||||
if (!(flags & TREESAME))
|
if (!(flags & TREESAME))
|
||||||
|
Reference in New Issue
Block a user