Re: [PATCH] reduce_heads: fix memory leaks

2017-11-02 Thread Martin Ågren
On 2 November 2017 at 04:11, Junio C Hamano wrote: > Martin Ågren writes: > >> diff --git a/builtin/merge-base.c b/builtin/merge-base.c >> index 6dbd167d3..b1b7590c4 100644 >> --- a/builtin/merge-base.c >> +++ b/builtin/merge-base.c >> @@ -59,6 +59,8 @@

Re: [PATCH] reduce_heads: fix memory leaks

2017-11-01 Thread Junio C Hamano
Martin Ågren writes: > diff --git a/builtin/merge-base.c b/builtin/merge-base.c > index 6dbd167d3..b1b7590c4 100644 > --- a/builtin/merge-base.c > +++ b/builtin/merge-base.c > @@ -59,6 +59,8 @@ static int handle_independent(int count, const char **args) >

[PATCH] reduce_heads: fix memory leaks

2017-11-01 Thread Martin Ågren
We currently have seven callers of `reduce_heads(foo)`. Six of them do not use the original list `foo` again, and actually, all six of those end up leaking it. Introduce and use `reduce_heads_replace()` as a leak-free version of `foo = reduce_heads(foo)` to fix several of these. Fix the remaining