diff options
author | Jirka Hruška <jirka@fud.cz> | 2010-09-01 10:59:35 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-09-01 12:24:44 +0100 |
commit | 61e14cb44198449802cc50bc000890b1db9ba3f2 (patch) | |
tree | eca0bd13b51150de14acff68eca3865a6a8d0893 | |
parent | 7b1903740d907382fa6f406bd7ab1262921746c8 (diff) | |
download | perl-61e14cb44198449802cc50bc000890b1db9ba3f2.tar.gz |
Memory leak cloning PVGVs
[perl #77352]
In S_sv_dup_common, Perl_rvpv_dup was called twice on a non-GP PVGV value,
causing the first duped value to be leaked
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | sv.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -493,6 +493,7 @@ Jim Meyering <meyering@asic.sc.ti.com> Jim Miner <jfm@winternet.com> Jim Richardson Jim Schneider <jschneid@netilla.com> +Jirka Hruška <jirka@fud.cz> Joachim Huober Jochen Wiedmann <joe@ispsoft.de> Jody Belka <dev-perl@pimb.org> @@ -11412,6 +11412,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) else LvTARG(dstr) = sv_dup_inc(LvTARG(dstr), param); case SVt_PVGV: + /* non-GP case already handled above */ if(isGV_with_GP(sstr)) { GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param); /* Don't call sv_add_backref here as it's going to be @@ -11425,8 +11426,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) Perl_sv_add_backref(aTHX_ MUTABLE_SV(GvSTASH(dstr)), dstr); GvGP(dstr) = gp_dup(GvGP(sstr), param); (void)GpREFCNT_inc(GvGP(dstr)); - } else - Perl_rvpv_dup(aTHX_ dstr, sstr, param); + } break; case SVt_PVIO: /* PL_parser->rsfp_filters entries have fake IoDIRP() */ |