The bug is in xmalloc, meaning that it assumes that returning NULL is
always an error. Presumably xmalloc should look *either* like:
void *xmalloc(size_t s)
{
void *p = malloc(s);
if ( !p && s )
barf();
else
return p;
}
... or ...
void *xmalloc(size_t s)
{
void *p;
/* Always return a valid allocation */
if ( s == 0 ) s = 1;
p = malloc(s);
if ( !p )
barf();
else
return p;
}
-- <hpa@transmeta.com> at work, <hpa@zytor.com> in private! "Unix gives you enough rope to shoot yourself in the foot." Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/