diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 9 |
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 @@ | |||
| 1 | /* Storage allocation and gc for GNU Emacs Lisp interpreter. | 1 | /* Storage allocation and gc for GNU Emacs Lisp interpreter. |
| 2 | Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -163,7 +163,12 @@ xrealloc (block, size) | |||
| 163 | { | 163 | { |
| 164 | register long *val; | 164 | register long *val; |
| 165 | 165 | ||
| 166 | val = (long *) realloc (block, size); | 166 | /* We must call malloc explicitly when BLOCK is 0, since some |
| 167 | reallocs don't do this. */ | ||
| 168 | if (! block) | ||
| 169 | val = (long *) malloc (size); | ||
| 170 | ese | ||
| 171 | val = (long *) realloc (block, size); | ||
| 167 | 172 | ||
| 168 | if (!val && size) memory_full (); | 173 | if (!val && size) memory_full (); |
| 169 | return val; | 174 | return val; |