diff options
Diffstat (limited to 'gcc/mips-tfile.c')
-rw-r--r-- | gcc/mips-tfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index 95683f34eec..588f4efedc3 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -5710,7 +5710,11 @@ xrealloc (ptr, size) PTR ptr; size_t size; { - register PTR result = (PTR) realloc (ptr, size); + register PTR result; + if (ptr) + result = (PTR) realloc (ptr, size); + else + result = (PTR) malloc (size); if (!result) fatal ("Virtual memory exhausted."); |