Browse Source

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>
maint
Martin Ågren 7 years ago committed by Junio C Hamano
parent
commit
fc5c40bb2b
  1. 4
      bisect.c

4
bisect.c

@ -379,8 +379,10 @@ void find_bisection(struct commit_list **commit_list, int *reaches, @@ -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))

Loading…
Cancel
Save