From 1ebeb52021fe082ac7aa4174f44bfab8ba2ff60d Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 1 Feb 2000 14:02:23 +0000 Subject: zsh-workers/9505 --- Src/mem.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src/mem.c') diff --git a/Src/mem.c b/Src/mem.c index 4936a5e73..d6fb293d0 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -356,6 +356,10 @@ zhalloc(size_t size) n = (n + pgsz) & ~pgsz; h = (Heap) mmap(NULL, n, PROT_READ | PROT_WRITE, MMAP_FLAGS, -1, 0); + if (h == ((Heap) -1)) { + zerr("fatal error: out of heap memory", NULL, 0); + exit(1); + } h->size = n; } #else -- cgit 1.4.1