Subject: Re: Why does saferealloc(NULL,size) croak? [PATCH] against _66
Message-ID: <
35831f69.4975644@smtp1.ibm.net>
p4raw-id: //depot/perl@1125
perl_atexit(void (*fn) (void *), void *ptr)
#endif
{
- if(exitlist)
- Renew(exitlist, exitlistlen+1, PerlExitListEntry);
- else
- New(999, exitlist, 1, PerlExitListEntry);
+ Renew(exitlist, exitlistlen+1, PerlExitListEntry);
exitlist[exitlistlen].fn = fn;
exitlist[exitlistlen].ptr = ptr;
++exitlistlen;
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( {