From: Jarkko Hietaniemi Date: Sat, 30 Dec 2000 00:38:32 +0000 (+0000) Subject: (Retracted by #8261). (Unsuccessful memory access tweaks.) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9692f7e7da6d0e69b8995374e7ea7d5f6bd54236;p=p5sagit%2Fp5-mst-13.2.git (Retracted by #8261). (Unsuccessful memory access tweaks.) p4raw-id: //depot/perl@8261 --- diff --git a/hv.c b/hv.c index f5aa4a8..867c0b2 100644 --- a/hv.c +++ b/hv.c @@ -1225,7 +1225,8 @@ Perl_hv_undef(pTHX_ HV *hv) return; xhv = (XPVHV*)SvANY(hv); hfreeentries(hv); - Safefree(xhv->xhv_array); + if (xhv->xhv_array) + Safefree(xhv->xhv_array); if (HvNAME(hv)) { Safefree(HvNAME(hv)); HvNAME(hv) = 0; diff --git a/util.c b/util.c index 0dd9fad..d089df4 100644 --- a/util.c +++ b/util.c @@ -533,7 +533,7 @@ Perl_new_collate(pTHX_ char *newcoll) if (! newcoll) { if (PL_collation_name) { - ++PL_collation_ix; + PL_collation_ix++; Safefree(PL_collation_name); PL_collation_name = NULL; } @@ -544,9 +544,10 @@ Perl_new_collate(pTHX_ char *newcoll) } if (! PL_collation_name || strNE(PL_collation_name, newcoll)) { - ++PL_collation_ix; - Safefree(PL_collation_name); - PL_collation_name = stdize_locale(savepv(newcoll)); + PL_collation_ix++; + if (PL_collation_name) + Safefree(PL_collation_name); + PL_collation_name = stdize_locale(newcoll); PL_collation_standard = (strEQ(newcoll, "C") || strEQ(newcoll, "POSIX")); { @@ -605,8 +606,9 @@ Perl_new_numeric(pTHX_ char *newnum) } if (! PL_numeric_name || strNE(PL_numeric_name, newnum)) { - Safefree(PL_numeric_name); - PL_numeric_name = stdize_locale(savepv(newnum)); + if (PL_numeric_name) + Safefree(PL_numeric_name); + PL_numeric_name = stdize_locale(newnum); PL_numeric_standard = (strEQ(newnum, "C") || strEQ(newnum, "POSIX")); PL_numeric_local = TRUE; set_numeric_radix();