1
0
mirror of https://github.com/git/git.git synced 2024-09-28 10:00:54 +02:00

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:
Martin Ågren 2017-11-05 21:24:29 +01:00 committed by Junio C Hamano
parent 24d707f636
commit fc5c40bb2b

View File

@ -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))