Retract #8261.
Jarkko Hietaniemi [Sat, 30 Dec 2000 00:45:14 +0000 (00:45 +0000)]
p4raw-id: //depot/perl@8262

hv.c
util.c

diff --git a/hv.c b/hv.c
index 867c0b2..f5aa4a8 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1225,8 +1225,7 @@ Perl_hv_undef(pTHX_ HV *hv)
        return;
     xhv = (XPVHV*)SvANY(hv);
     hfreeentries(hv);
-    if (xhv->xhv_array)
-       Safefree(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 d089df4..0dd9fad 100644 (file)
--- 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,10 +544,9 @@ Perl_new_collate(pTHX_ char *newcoll)
     }
 
     if (! PL_collation_name || strNE(PL_collation_name, newcoll)) {
-       PL_collation_ix++;
-       if (PL_collation_name)
-           Safefree(PL_collation_name);
-       PL_collation_name = stdize_locale(newcoll);
+       ++PL_collation_ix;
+       Safefree(PL_collation_name);
+       PL_collation_name = stdize_locale(savepv(newcoll));
        PL_collation_standard = (strEQ(newcoll, "C") || strEQ(newcoll, "POSIX"));
 
        {
@@ -606,9 +605,8 @@ Perl_new_numeric(pTHX_ char *newnum)
     }
 
     if (! PL_numeric_name || strNE(PL_numeric_name, newnum)) {
-       if (PL_numeric_name)
-           Safefree(PL_numeric_name);
-       PL_numeric_name = stdize_locale(newnum);
+       Safefree(PL_numeric_name);
+       PL_numeric_name = stdize_locale(savepv(newnum));
        PL_numeric_standard = (strEQ(newnum, "C") || strEQ(newnum, "POSIX"));
        PL_numeric_local = TRUE;
        set_numeric_radix();