Re: [PATCH 03/16] object_array: factor out slopbuf-freeing logic

2014-10-08 Thread Jeff King
On Wed, Oct 08, 2014 at 10:40:03AM +0200, Michael Haggerty wrote: > > The intent of this function is freeing memory, not clearing it for sane > > reuse. I think I'd be more in favor of a comment clarifying that. It is > > a static function used only internally by the object-array code. > > I gue

Re: [PATCH 03/16] object_array: factor out slopbuf-freeing logic

2014-10-08 Thread Michael Haggerty
On 10/08/2014 09:36 AM, Jeff King wrote: > On Tue, Oct 07, 2014 at 01:25:54PM +0200, Michael Haggerty wrote: > >>> +static void object_array_release_entry(struct object_array_entry *ent) >>> +{ >>> + if (ent->name != object_array_slopbuf) >>> + free(ent->name); >>> +} >>> + >> >> Would

Re: [PATCH 03/16] object_array: factor out slopbuf-freeing logic

2014-10-08 Thread Jeff King
On Tue, Oct 07, 2014 at 01:25:54PM +0200, Michael Haggerty wrote: > > +static void object_array_release_entry(struct object_array_entry *ent) > > +{ > > + if (ent->name != object_array_slopbuf) > > + free(ent->name); > > +} > > + > > Would it be a little safer to set ent->name to NULL

Re: [PATCH 03/16] object_array: factor out slopbuf-freeing logic

2014-10-07 Thread Michael Haggerty
On 10/03/2014 10:22 PM, Jeff King wrote: > This is not a lot of code, but it's a logical construct that > should not need to be repeated (and we are about to add a > third repetition). > > Signed-off-by: Jeff King > --- > object.c | 12 > 1 file changed, 8 insertions(+), 4 deletions

[PATCH 03/16] object_array: factor out slopbuf-freeing logic

2014-10-03 Thread Jeff King
This is not a lot of code, but it's a logical construct that should not need to be repeated (and we are about to add a third repetition). Signed-off-by: Jeff King --- object.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/object.c b/object.c index ca9d790..1423