Subject: Re: Problems with 2006Q3
To: None <firstname.lastname@example.org>
From: Tom Spindler <email@example.com>
Date: 11/03/2006 01:21:28
> A free(3) which doesn't support being called with a NULL pointer is just
> broken. What malloc does for size 0 is implementation defined.
> Consistent with the spirit of the standard could be a wrapper which
> turns allocations for 0 into allocations of 1, if a program depends on
To amplify this, IEEE 1003.1-2004 says for free():
If ptr is a null pointer, no action shall occur.
and for malloc():
If size is 0, either a null pointer or a unique pointer that can
be successfully passed to free() shall be returned.