Comment 7 for bug 331095

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 331095] Re: patiencediff tries to malloc 0 bytes; tests fail on AIX

On 11 February 2010 20:39, fullermd <email address hidden> wrote:
>> Actually it seems it is portable that free(NULL) is a no-op, so #1
>> is the way to go.
>
> It's common, but not necessary; free(NULL) falls into undefined
> behavior, and it's possible that some cases may cause nasal demons.
> Older versions of dmalloc errored by default on it, for instance.
>
> That said, I don't offhand know of any current or not-so-current
> system malloc implementation that chokes on it.

If it happens it will be obvious.

It looks like we're already counting on that behaviour anyhow.

--
Martin <http://launchpad.net/~mbp/>