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 коммит произвёл Junio C Hamano
Родитель 24d707f636
Коммит fc5c40bb2b
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

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