From: Pavel Charvat Date: Thu, 28 Nov 2013 12:09:47 +0000 (+0100) Subject: LibUCW: xrealloc(ptr, 0) should return NULL and not die. X-Git-Tag: v5.99~67 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8492dba65d1c805315ffd5d3b2addca3c293d3f0;p=libucw.git LibUCW: xrealloc(ptr, 0) should return NULL and not die. --- diff --git a/ucw/realloc.c b/ucw/realloc.c index 3f2eff2b..4a15e3aa 100644 --- a/ucw/realloc.c +++ b/ucw/realloc.c @@ -16,7 +16,7 @@ xrealloc(void *old, size_t size) { /* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */ void *x = realloc(old, size); - if (!x) + if (!x && size) die("Cannot reallocate %zu bytes of memory", size); return x; }