Sync with the version from emacs-20.5.
authorJim Meyering <jim@meyering.net>
Sun, 16 Jan 2000 12:35:49 +0000 (12:35 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 16 Jan 2000 12:35:49 +0000 (12:35 +0000)
(<string.h>): Include if HAVE_STRING_H.
(<stdlib.h>): Include if HAVE_STDLIB_H.
(alloca): Abort if malloc fails.

lib/alloca.c

index b102eb11bfec0613521a05828b80f0bdb31ba781..55a80677f78b85d223cf96436a08af52b667fdf2 100644 (file)
 # 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 @@ alloca (unsigned size)
     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;