On Sat, Mar 18, 2017 at 10:12:07AM -0700, Junio C Hamano wrote:

> >> -  argv_array_push(&proc.args, hook);
> >>    for (cmd = commands; cmd; cmd = cmd->next) {
> >>            if (cmd->error_string || cmd->did_not_exist)
> >>                    continue;
> >> +          if (!proc.args.argc)
> >> +                  argv_array_push(&proc.args, hook);
> >>            argv_array_push(&proc.args, cmd->ref_name);
> >>    }
> >> +  if (!proc.args.argc)
> >> +          return;
> >
> > It looks at first like the result leaks, because you have to realize
> > that the push will modify proc.args.argc. 
> 
> Hmph, I needed to read the original twice to imagine how a paranoid
> person can fear leaks.  The return condition says "if args array is
> empty, just return" and the thing being empty is an enough indication
> to think nothing is leaking, at least for me.

Yeah, I think I just read it funny the first time. I'm OK with it as-is.

-Peff

Reply via email to