Rafael Garcia-Suarez
2009-05-30 14:05:09 UTC
In perl.git, the branch blead has been updated
<http://perl5.git.perl.org/perl.git/commitdiff/cda5537682a2f5132de1e0387c105e67a72efce4?hp=f6c108d16c4c959f6b02d66f43f3ee84cbcc24b8>
- Log -----------------------------------------------------------------
commit cda5537682a2f5132de1e0387c105e67a72efce4
Author: Alex Vandiver <***@mit.edu>
Date: Fri May 29 20:17:36 2009 -0400
Fix [RT#63110] -- two small memory leaks were introduced in 5b9c067
-----------------------------------------------------------------------
Summary of changes:
hv.c | 2 +-
pp_ctl.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hv.c b/hv.c
index a6b4448..79d1944 100644
--- a/hv.c
+++ b/hv.c
@@ -1444,7 +1444,7 @@ Perl_hv_copy_hints_hv(pTHX_ HV *const ohv)
while ((entry = hv_iternext_flags(ohv, 0))) {
SV *const sv = newSVsv(HeVAL(entry));
sv_magic(sv, NULL, PERL_MAGIC_hintselem,
- (char *)newSVhek (HeKEY_hek(entry)), HEf_SVKEY);
+ (char *)sv_2mortal(newSVhek (HeKEY_hek(entry))), HEf_SVKEY);
(void)hv_store_flags(hv, HeKEY(entry), HeKLEN(entry),
sv, HeHASH(entry), HeKFLAGS(entry));
}
diff --git a/pp_ctl.c b/pp_ctl.c
index 5adfc68..a7f1b76 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3668,8 +3668,11 @@ PP(pp_entereval)
introduced within evals. See force_ident(). GSAR 96-10-12 */
SAVEHINTS();
PL_hints = PL_op->op_targ;
- if (saved_hh)
+ if (saved_hh) {
+ /* SAVEHINTS created a new HV in PL_hintgv, which we need to GC */
+ SvREFCNT_dec(GvHV(PL_hintgv));
GvHV(PL_hintgv) = saved_hh;
+ }
SAVECOMPILEWARNINGS();
PL_compiling.cop_warnings = DUP_WARNINGS(PL_curcop->cop_warnings);
if (PL_compiling.cop_hints_hash) {
--
Perl5 Master Repository
<http://perl5.git.perl.org/perl.git/commitdiff/cda5537682a2f5132de1e0387c105e67a72efce4?hp=f6c108d16c4c959f6b02d66f43f3ee84cbcc24b8>
- Log -----------------------------------------------------------------
commit cda5537682a2f5132de1e0387c105e67a72efce4
Author: Alex Vandiver <***@mit.edu>
Date: Fri May 29 20:17:36 2009 -0400
Fix [RT#63110] -- two small memory leaks were introduced in 5b9c067
-----------------------------------------------------------------------
Summary of changes:
hv.c | 2 +-
pp_ctl.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hv.c b/hv.c
index a6b4448..79d1944 100644
--- a/hv.c
+++ b/hv.c
@@ -1444,7 +1444,7 @@ Perl_hv_copy_hints_hv(pTHX_ HV *const ohv)
while ((entry = hv_iternext_flags(ohv, 0))) {
SV *const sv = newSVsv(HeVAL(entry));
sv_magic(sv, NULL, PERL_MAGIC_hintselem,
- (char *)newSVhek (HeKEY_hek(entry)), HEf_SVKEY);
+ (char *)sv_2mortal(newSVhek (HeKEY_hek(entry))), HEf_SVKEY);
(void)hv_store_flags(hv, HeKEY(entry), HeKLEN(entry),
sv, HeHASH(entry), HeKFLAGS(entry));
}
diff --git a/pp_ctl.c b/pp_ctl.c
index 5adfc68..a7f1b76 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3668,8 +3668,11 @@ PP(pp_entereval)
introduced within evals. See force_ident(). GSAR 96-10-12 */
SAVEHINTS();
PL_hints = PL_op->op_targ;
- if (saved_hh)
+ if (saved_hh) {
+ /* SAVEHINTS created a new HV in PL_hintgv, which we need to GC */
+ SvREFCNT_dec(GvHV(PL_hintgv));
GvHV(PL_hintgv) = saved_hh;
+ }
SAVECOMPILEWARNINGS();
PL_compiling.cop_warnings = DUP_WARNINGS(PL_curcop->cop_warnings);
if (PL_compiling.cop_hints_hash) {
--
Perl5 Master Repository