summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1995-03-13 16:43:53 -0800
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-03-15 12:25:31 +1300
commitcb0b1708c66ad12be7ce52c00b9565faecc67579 (patch)
treea00bd0a909256197e93ece28385885d7fa663be1 /pp_ctl.c
parente9a444f0e2e25089238ff153c447ef9ed7d3f72c (diff)
downloadperl-cb0b1708c66ad12be7ce52c00b9565faecc67579.tar.gz
[fix s/// memory leak]
In fixing another bug I installed a nasty memory leak in s///. Here's the fix. Larry
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index cca1fc1b13..201c32e90b 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -114,6 +114,7 @@ PP(pp_substcont)
SV *targ = cx->sb_targ;
sv_catpvn(dstr, s, cx->sb_strend - s);
+ Safefree(SvPVX(targ));
SvPVX(targ) = SvPVX(dstr);
SvCUR_set(targ, SvCUR(dstr));
SvLEN_set(targ, SvLEN(dstr));