From: Nicholas Clark Date: Fri, 21 Aug 2009 20:28:18 +0000 (+0100) Subject: Eliminate SV leak in mro::_nextcan - hv_store_ent()'s "key" doesn't take a ref. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59d8e2ce29a35e6a471501e81a266a06df49dd05;p=p5sagit%2Fp5-mst-13.2.git Eliminate SV leak in mro::_nextcan - hv_store_ent()'s "key" doesn't take a ref. --- diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs index 92be620..6fb37fb 100644 --- a/ext/mro/mro.xs +++ b/ext/mro/mro.xs @@ -633,14 +633,14 @@ mro__nextcan(...) valid for the child */ if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) { SvREFCNT_inc_simple_void_NN(MUTABLE_SV(cand_cv)); - (void)hv_store_ent(nmcache, newSVsv(sv), MUTABLE_SV(cand_cv), 0); + (void)hv_store_ent(nmcache, sv, MUTABLE_SV(cand_cv), 0); mXPUSHs(newRV_inc(MUTABLE_SV(cand_cv))); XSRETURN(1); } } } - (void)hv_store_ent(nmcache, newSVsv(sv), &PL_sv_undef, 0); + (void)hv_store_ent(nmcache, sv, &PL_sv_undef, 0); if(throw_nomethod) Perl_croak(aTHX_ "No next::method '%s' found for %s", subname, hvname); XSRETURN_EMPTY;