From: Gisle Aas Date: Mon, 2 Feb 1998 15:06:50 +0000 (+0100) Subject: nomemok X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=422a93e5e605f49adf92459c8057743dcf5a998b;p=p5sagit%2Fp5-mst-13.2.git nomemok p4raw-id: //depot/perl@475 --- diff --git a/hv.c b/hv.c index cd410eb..b1e095a 100644 --- a/hv.c +++ b/hv.c @@ -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,