changeset 2133:b7ff3516d789

Sync with the version from emacs-20.5. (<string.h>): Include if HAVE_STRING_H. (<stdlib.h>): Include if HAVE_STDLIB_H. (alloca): Abort if malloc fails.
author Jim Meyering <jim@meyering.net>
date Sun, 16 Jan 2000 12:35:49 +0000
parents d3130e90ffb1
children 37aabb007743
files lib/alloca.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/alloca.c
+++ b/lib/alloca.c
@@ -25,6 +25,13 @@
 # include <config.h>
 #endif
 
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
 #ifdef emacs
 # include "blockinput.h"
 #endif
@@ -210,6 +217,9 @@
     register pointer new = malloc (sizeof (header) + size);
     /* Address of header.  */
 
+    if (new == 0)
+      abort();
+
     ((header *) new)->h.next = last_alloca_header;
     ((header *) new)->h.deep = depth;