xserver: Cleaning up memory allocation functions and macros
daniel at fooishbar.org
Mon Apr 30 14:50:24 PDT 2007
On Mon, Apr 30, 2007 at 01:18:47PM -0700, Alan Coopersmith wrote:
> Egbert Eich wrote:
> > > - free() can take NULL as argument, so it's not needed to test for
> > NULL > before calling it.
> >Maybe not on all implementations? If we use a wrapper or macro this
> >can be handled there. The default wrapper doesn't need to address this.
> Digging out my ancient copy of the Annotated ANSI C Standard (C89), it
> free(NULL) to be safe - "If ptr is a null pointer, no action occurs."
Likewise, the standard specifies realloc() to malloc() on NULL.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: Digital signature
More information about the xorg