From dbe2fffcb043e3f633e8c31acbe8a158c7083248 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 24 Oct 2010 10:42:33 -0700 Subject: [PATCH] Make mro_package_moved use a mortal in case mro_isa_changed_in3 croaks --- mro.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mro.c b/mro.c index b065d70..8fe6b20 100644 --- a/mro.c +++ b/mro.c @@ -631,7 +631,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, const HV * const oldstash, /* Skip the entire loop if the hash is empty. */ if(oldstash && HvUSEDKEYS(oldstash)) { xhv = (XPVHV*)SvANY(oldstash); - seen = newHV(); + seen = (HV *) sv_2mortal((SV *)newHV()); /* Iterate through entries in the oldstash, calling mro_package_moved( @@ -734,7 +734,6 @@ Perl_mro_package_moved(pTHX_ HV * const stash, const HV * const oldstash, } } - if(seen) SvREFCNT_dec((SV *)seen); } /* -- 2.7.4