diff options
author | Richard Henderson <rth@cygnus.com> | 1999-01-21 09:47:36 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-01-21 09:47:36 -0800 |
commit | 470b68c0a905424b48946238ab2016d0a720d7ae (patch) | |
tree | 50ef143756292df471dad464af598c9175f80804 /gcc/genconfig.c | |
parent | d202e8aa05a8335dc8c25e04c396a453b2a2645e (diff) | |
download | gcc-470b68c0a905424b48946238ab2016d0a720d7ae.zip gcc-470b68c0a905424b48946238ab2016d0a720d7ae.tar.gz gcc-470b68c0a905424b48946238ab2016d0a720d7ae.tar.bz2 |
cccp.c (xrealloc): Call malloc given a NULL old pointer.
* cccp.c (xrealloc): Call malloc given a NULL old pointer.
* collect2.c, cppalloc.c, gcc.c, genattr.c, genattrtab.c: Likewise.
* gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
* genflags.c, genopinit.c, genoutput.c, genpeep.c: Likewise.
* genrecog.c, mips-tfile.c, protoize.c: Likewise.
From-SVN: r24806
Diffstat (limited to 'gcc/genconfig.c')
-rw-r--r-- | gcc/genconfig.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 6a72e26..60c0e97 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -257,14 +257,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 |