From 1e0299c1c080f70f32420b28ec18070d2eb782df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 9 Nov 2010 21:30:16 +0100 Subject: [PATCH] Fix malloc success check On AIX and Tru64 I had issues with this: If you allocate 0 byte then you may get a NULL pointer back, which is not a sign of an error. --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index ae1600698..73c192018 100644 --- a/util.c +++ b/util.c @@ -543,7 +543,7 @@ x_malloc(size_t size) { void *ret; ret = malloc(size); - if (!ret) { + if (!ret && size) { fatal("x_malloc: Could not allocate %lu bytes", (unsigned long)size); } return ret; -- 2.47.2