This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] vfprintf: validate nargs and maybe allocate from heap


> On Mon, Feb 06, 2012 at 04:18:52PM +0100, Andreas Schwab wrote:
> > Paul Eggert <eggert@cs.ucla.edu> writes:
> > 
> > >   all_done:
> > >     if (__builtin_expect (args_malloced != NULL, 0))
> > >       free (args_malloced);
> > 
> > No need for the NULL check.
> 
> Ah, perhaps I misunderstood earlier style requirements. I was told not to
> use implicit NULL tests. What're the other conventions around that?

Here he didn't mean to write "!args_malloced" (which is against our style).
He meant to call free unconditionally, since calling it with a null pointer
is a no-op.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]