From 8492dba65d1c805315ffd5d3b2addca3c293d3f0 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 28 Nov 2013 13:09:47 +0100 Subject: [PATCH] LibUCW: xrealloc(ptr, 0) should return NULL and not die. --- ucw/realloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5