summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 24bb67c6dda..6cff322182d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -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 @@ xrealloc (block, size)
{
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;