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/protoize.c | |
parent | d202e8aa05a8335dc8c25e04c396a453b2a2645e (diff) | |
download | gcc-470b68c0a905424b48946238ab2016d0a720d7ae.tar.gz |
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/protoize.c')
-rw-r--r-- | gcc/protoize.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c index 44c2dbe6676..4979c04c14f 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -608,7 +608,11 @@ xrealloc (old_space, byte_count) pointer_type old_space; size_t byte_count; { - register pointer_type rv = (pointer_type) realloc (old_space, byte_count); + register pointer_type rv; + if (old_space) + rv = (pointer_type) realloc (old_space, byte_count); + else + rv = (pointer_type) malloc (byte_count); if (rv == NULL) { fprintf (stderr, "\n%s: virtual memory exceeded\n", pname); |