From: Dave Mitchell Date: Sat, 20 May 2006 14:30:50 +0000 (+0000) Subject: eval { s/$foo/die/e } leaked a scalar X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cff085c1df60b77b6a2dbefd408f54bb564b8353;p=p5sagit%2Fp5-mst-13.2.git eval { s/$foo/die/e } leaked a scalar p4raw-id: //depot/perl@28254 --- diff --git a/pp_ctl.c b/pp_ctl.c index 21b96f7..1cdf592 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -245,7 +245,6 @@ PP(pp_substcont) if (DO_UTF8(dstr)) SvUTF8_on(targ); SvPV_set(dstr, NULL); - sv_free(dstr); TAINT_IF(cx->sb_rxtainted & 1); PUSHs(sv_2mortal(newSViv(saviters - 1))); diff --git a/pp_hot.c b/pp_hot.c index 7b0c128..891f3de 100644 --- 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;