From 2f0efe9f592255d0d83c0929423cc397bb1ebfa4 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 24 Jul 2014 08:45:16 -0700 Subject: 32853: redefine VARARR() to use heap rather than stack allocation enable old behavior via "configure --with-stack-allocation" --- Src/mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Src/mem.c') 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(); -- cgit 1.4.1