diff options
Diffstat (limited to 'gcc/genpeep.c')
-rw-r--r-- | gcc/genpeep.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/genpeep.c b/gcc/genpeep.c index 4330b48dd8d..50c86a941c3 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -396,14 +396,18 @@ xmalloc (size) } PTR -xrealloc (ptr, size) - PTR ptr; +xrealloc (old, size) + PTR old; size_t size; { - register PTR result = (PTR) realloc (ptr, size); - if (!result) + register PTR ptr; + if (ptr) + ptr = (PTR) realloc (old, size); + else + ptr = (PTR) malloc (size); + if (!ptr) fatal ("virtual memory exhausted"); - return result; + return ptr; } static void |