aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 2184e0e..36b4cd1 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -531,14 +531,18 @@ xmalloc (size)
}
PTR
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
size_t size;
{
- register PTR value = (PTR) realloc (ptr, size);
- if (value == 0)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (ptr == 0)
fatal ("virtual memory exhausted");
- return value;
+ return ptr;
}
int