perl/perl-5.12.1-fix_thread_leak.patch
Petr Písař c07a2fad0d Do not leak when destroying thread
RT #77352, RHBZ #630667
Fix picked up from blead upstream git branch.
2010-09-07 13:49:15 +02:00

72 lines
2.0 KiB
Diff

commit 6ad76e39ed152a180816212ff7b4f798b1ab9bf0
Author: Jirka Hruška <jirka@fud.cz>
Date: Wed Sep 1 11:18:43 2010 +0100
PL_my_cxt_list leaks
[perl #77352]
PL_my_cxt_list was never freed
diff --git a/perl.c b/perl.c
index dfb549d..0acd7ff 100644
--- a/perl.c
+++ b/perl.c
@@ -1069,6 +1069,10 @@ perl_destruct(pTHXx)
(long)cxstack_ix + 1);
}
+ /* the entries in this list are allocated via SV PVX's, so get freed
+ * in sv_clean_all */
+ Safefree(PL_my_cxt_list);
+
/* Now absolutely destruct everything, somehow or other, loops or no. */
/* the 2 is for PL_fdpid and PL_strtab */
commit 56d1e8d38e36ab7813af488eb8759b90bc82dd4a
Author: Jirka Hruška <jirka@fud.cz>
Date: Wed Sep 1 10:59:35 2010 +0100
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
diff --git a/AUTHORS b/AUTHORS
index 24ac6c3..7fc93a1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -487,6 +487,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>
diff --git a/sv.c b/sv.c
index b6c03ed..11587d4 100644
--- a/sv.c
+++ b/sv.c
@@ -11120,6 +11120,7 @@ Perl_sv_dup(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
@@ -11143,8 +11144,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
}
GvGP(dstr) = gp_dup(GvGP(sstr), param);
(void)GpREFCNT_inc(GvGP(dstr));
- } else
- Perl_rvpv_dup(aTHX_ dstr, sstr, param);
+ }
break;
case SVt_PVIO:
IoIFP(dstr) = fp_dup(IoIFP(dstr), IoTYPE(dstr), param);