Re: [PATCH v2 4/6] object_array: use `object_array_clear()`, not `free()`

2017-09-23 Thread Martin Ågren
On 23 September 2017 at 06:04, Jeff King wrote: > On Sat, Sep 23, 2017 at 01:34:52AM +0200, Martin Ågren wrote: > >> The way we handle `study` in builting/reflog.c still looks like it might >> leak. That will be addressed in the next commit. > > This confused me for a minute, since the leak is not

Re: [PATCH v2 4/6] object_array: use `object_array_clear()`, not `free()`

2017-09-22 Thread Jeff King
On Sat, Sep 23, 2017 at 01:34:52AM +0200, Martin Ågren wrote: > Instead of freeing `foo.objects` for an object array `foo` (sometimes > conditionally), call `object_array_clear(&foo)`. This means we don't > poke as much into the implementation, which is already a good thing, but > also that we rel

[PATCH v2 4/6] object_array: use `object_array_clear()`, not `free()`

2017-09-22 Thread Martin Ågren
Instead of freeing `foo.objects` for an object array `foo` (sometimes conditionally), call `object_array_clear(&foo)`. This means we don't poke as much into the implementation, which is already a good thing, but also that we release the individual entries as well, thereby fixing at least one memory