aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 39f2dac..166c6ad 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -10743,7 +10743,11 @@ xrealloc (old, size)
PTR old;
size_t size;
{
- register PTR ptr = (PTR) realloc (old, size);
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
if (!ptr)
memory_full ();
return ptr;