OSDN Git Service

bisect: fix memory leak when returning best element
authorMartin Ågren <martin.agren@gmail.com>
Sun, 5 Nov 2017 20:24:31 +0000 (21:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Nov 2017 01:15:29 +0000 (10:15 +0900)
commitf4e45cb3eb6fad4570ff63eecb37bae8102992fc
tree6c5bcac21f03ec8d0af24dbd4a2704dcacd51c87
parent7c117184d7e3727d4240beb42148d106483d00b9
bisect: fix memory leak when returning best element

When `find_bisection()` returns a single list entry, it leaks the other
entries. Move the to-be-returned item to the front and free the
remainder.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c