diff options
author | Gisle Aas <gisle@aas.no> | 1998-02-02 16:06:50 +0100 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-06 16:44:57 +0000 |
commit | 422a93e5e605f49adf92459c8057743dcf5a998b (patch) | |
tree | 597cc5fe15bd5a6caa28669c07e7b7a17e7d7672 /hv.c | |
parent | 4dbb2df9033a1a358a66bce3293b105dd8f84d8c (diff) | |
download | perl-422a93e5e605f49adf92459c8057743dcf5a998b.tar.gz |
nomemok
p4raw-id: //depot/perl@475
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -676,6 +676,10 @@ hsplit(HV *hv) nomemok = TRUE; #ifdef STRANGE_MALLOC Renew(a, newsize, HE*); + if (!a) { + nomemok = FALSE; + return; + } #else i = newsize * sizeof(HE*); #define MALLOC_OVERHEAD 16 @@ -686,6 +690,10 @@ hsplit(HV *hv) tmp /= sizeof(HE*); assert(tmp >= newsize); New(2,a, tmp, HE*); + if (!a) { + nomemok = FALSE; + return; + } Copy(xhv->xhv_array, a, oldsize, HE*); if (oldsize >= 64) { offer_nice_chunk(xhv->xhv_array, @@ -749,6 +757,10 @@ hv_ksplit(HV *hv, IV newmax) nomemok = TRUE; #ifdef STRANGE_MALLOC Renew(a, newsize, HE*); + if (!a) { + nomemok = FALSE; + return; + } #else i = newsize * sizeof(HE*); j = MALLOC_OVERHEAD; @@ -758,6 +770,10 @@ hv_ksplit(HV *hv, IV newmax) j /= sizeof(HE*); assert(j >= newsize); New(2, a, j, HE*); + if (!a) { + nomemok = FALSE; + return; + } Copy(xhv->xhv_array, a, oldsize, HE*); if (oldsize >= 64) { offer_nice_chunk(xhv->xhv_array, |