Skip to content

Commit fc5c40b

Browse files
Martin Ågrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 24d707f commit fc5c40b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bisect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,10 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
379379
unsigned flags = p->item->object.flags;
380380

381381
next = p->next;
382-
if (flags & UNINTERESTING)
382+
if (flags & UNINTERESTING) {
383+
free(p);
383384
continue;
385+
}
384386
p->next = last;
385387
last = p;
386388
if (!(flags & TREESAME))

0 commit comments

Comments
 (0)