changeset 590:1a6483439acc

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Fri, 20 Mar 1992 06:01:16 +0000
parents 03fd51103bc3
children 647732fc239f
files src/alloc.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Wed Mar 18 23:58:40 1992 +0000
+++ b/src/alloc.c	Fri Mar 20 06:01:16 1992 +0000
@@ -1,5 +1,5 @@
 /* Storage allocation and gc for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -163,7 +163,12 @@
 {
   register long *val;
 
-  val = (long *) realloc (block, size);
+  /* We must call malloc explicitly when BLOCK is 0, since some
+     reallocs don't do this.  */
+  if (! block)
+    val = (long *) malloc (size);
+  ese
+    val = (long *) realloc (block, size);
 
   if (!val && size) memory_full ();
   return val;