diff options
author | Jan Dubois <jand@activestate.com> | 1998-06-11 22:28:36 +0200 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-12 07:21:29 +0000 |
commit | 7614df0c0f0d0458f8f9c442cd557e6387b4e40d (patch) | |
tree | 0204adf5e339ef4cedeea4d74755a93a0d866e6a /util.c | |
parent | 98b8ca77004b7e8368865d4af1f1ec8d6a876c8c (diff) | |
download | perl-7614df0c0f0d0458f8f9c442cd557e6387b4e40d.tar.gz |
added patch, undo earlier workaround
Subject: Re: Why does saferealloc(NULL,size) croak? [PATCH] against _66
Message-ID: <35831f69.4975644@smtp1.ibm.net>
p4raw-id: //depot/perl@1125
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -122,13 +122,18 @@ saferealloc(Malloc_t where,MEM_SIZE size) my_exit(1); } #endif /* HAS_64K_LIMIT */ + if (!size) { + safefree(where); + return NULL; + } + if (!where) - croak("Null realloc"); + return safemalloc(size); #ifdef DEBUGGING if ((long)size < 0) croak("panic: realloc"); #endif - ptr = PerlMem_realloc(where,size?size:1); /* realloc(0) is NASTY on our system */ + ptr = PerlMem_realloc(where,size); #if !(defined(I286) || defined(atarist)) DEBUG_m( { |