summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>1998-06-11 22:28:36 +0200
committerGurusamy Sarathy <gsar@cpan.org>1998-06-12 07:21:29 +0000
commit7614df0c0f0d0458f8f9c442cd557e6387b4e40d (patch)
tree0204adf5e339ef4cedeea4d74755a93a0d866e6a /util.c
parent98b8ca77004b7e8368865d4af1f1ec8d6a876c8c (diff)
downloadperl-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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/util.c b/util.c
index 7479e478d0..294a68e3b9 100644
--- a/util.c
+++ b/util.c
@@ -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( {