In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c50bda7c602d34fbc8752fc972be6f3050164834?hp=cfb8f080895a44c06733a04064300a07f255aeb0>
- Log ----------------------------------------------------------------- commit c50bda7c602d34fbc8752fc972be6f3050164834 Author: Fuji, Goro <[email protected]> Date: Tue Jul 31 21:56:11 2012 +0900 fix a memory leak in sv_sethek(), amending 70b71ec84 the following code reproduced this issue on perl 5.16.0: my $o = bless {}; while (1) { for my $r([], $o) { ref $r; } } ----------------------------------------------------------------------- Summary of changes: sv.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sv.c b/sv.c index 1bccaae..b0eaf92 100644 --- a/sv.c +++ b/sv.c @@ -4553,6 +4553,7 @@ Perl_sv_sethek(pTHX_ register SV *const sv, const HEK *const hek) { SV_CHECK_THINKFIRST_COW_DROP(sv); SvUPGRADE(sv, SVt_PV); + Safefree(SvPVX(sv)); SvPV_set(sv,(char *)HEK_KEY(share_hek_hek(hek))); SvCUR_set(sv, HEK_LEN(hek)); SvLEN_set(sv, 0); -- Perl5 Master Repository
