Re: [PATCH 2/4] short circuit out of a few places where we would allocate zero bytes

From: H. Peter Anvin <hpa@zytor.com>
Date: 2005-12-28 15:22:42
Eric Wong wrote:
> dietlibc versions of malloc, calloc and realloc all return NULL if
> they're told to allocate 0 bytes, causes the x* wrappers to die().
> 
> There are several more places where these calls could end up asking
> for 0 bytes, too...
> 
> Maybe simply not die()-ing in the x* wrappers if 0/NULL is returned
> when the requested size is zero is a safer and easier way to go.
> 

Better yet, either always return NULL or allocate 1 byte in that case, 
to get consistent behaviour.

	-hpa

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Dec 28 15:23:48 2005

This archive was generated by hypermail 2.1.8 : 2005-12-28 15:23:56 EST