Let's not leak.
Jarkko Hietaniemi [Wed, 26 Jun 2002 15:25:45 +0000 (15:25 +0000)]
p4raw-id: //depot/perl@17362

pp_hot.c

index 526468d..7837f64 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1987,7 +1987,7 @@ PP(pp_subst)
        doutf8 = DO_UTF8(dstr);
        /* replacement needing upgrading? */
        if (DO_UTF8(TARG) && !doutf8) {
-            SV *nsv = newSVpvn(c, clen);
+            SV *nsv = sv_2mortal(newSVpvn(c, clen));
             if (PL_encoding)
                  sv_recode_to_utf8(nsv, PL_encoding);
             else