[fix s/// memory leak]
[perl.git] / pp_hot.c
index 7bfec4a..dedb217 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1451,6 +1451,7 @@ PP(pp_subst)
            safebase));
        sv_catpvn(dstr, s, strend - s);
 
+       Safefree(SvPVX(TARG));
        SvPVX(TARG) = SvPVX(dstr);
        SvCUR_set(TARG, SvCUR(dstr));
        SvLEN_set(TARG, SvLEN(dstr));