summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-05-20 14:30:50 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-05-20 14:30:50 +0000
commitcff085c1df60b77b6a2dbefd408f54bb564b8353 (patch)
tree9345f9af8d25a2bc0ad16284d406dd7f0246c421
parenta0a8d9d340b642dc325a8f62c6d29670624a4f55 (diff)
downloadperl-cff085c1df60b77b6a2dbefd408f54bb564b8353.tar.gz
eval { s/$foo/die/e } leaked a scalar
p4raw-id: //depot/perl@28254
-rw-r--r--pp_ctl.c1
-rw-r--r--pp_hot.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 21b96f76b7..1cdf5928a7 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 7b0c128c61..891f3de563 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;