about summary refs log tree commit diff
path: root/Src/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/mem.c')
-rw-r--r--Src/mem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/mem.c b/Src/mem.c
index a8f0c37ce..7e0667a33 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -950,7 +950,10 @@ zrealloc(void *ptr, size_t size)
 	ptr = NULL;
     } else {
 	/* If ptr is NULL, then behave like malloc */
-	ptr = malloc(size);
+        if (!(ptr = (void *) malloc(size))) {
+            zerr("fatal error: out of memory");
+            exit(1);
+        }
     }
     unqueue_signals();