Change 28404 broke the construct s/foo/<<BAR/e. So, try to be more
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index 7b0c128..891f3de 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2297,6 +2297,7 @@ PP(pp_subst)
 #endif
        rxtainted |= RX_MATCH_TAINTED(rx);
        dstr = newSVpvn(m, s-m);
+       SAVEFREESV(dstr);
        if (DO_UTF8(TARG))
            SvUTF8_on(dstr);
        PL_curpm = pm;
@@ -2353,7 +2354,6 @@ PP(pp_subst)
        SvLEN_set(TARG, SvLEN(dstr));
        doutf8 |= DO_UTF8(dstr);
        SvPV_set(dstr, NULL);
-       sv_free(dstr);
 
        TAINT_IF(rxtainted & 1);
        SPAGAIN;