From: Florian Ragwitz Date: Sat, 22 Aug 2009 09:26:23 +0000 (+0200) Subject: Eliminate SV leak in mro::_nextcan - hv_store_ent()'s "key" doesn't take a ref. X-Git-Tag: 0.12_02~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d581cf05b55a8bd9fe6268a1051ffdd82bc8f403;p=gitmo%2FClass-C3-XS.git Eliminate SV leak in mro::_nextcan - hv_store_ent()'s "key" doesn't take a ref. --- diff --git a/XS.xs b/XS.xs index 02f80ba..07f0a9b 100644 --- a/XS.xs +++ b/XS.xs @@ -514,7 +514,7 @@ XS(XS_Class_C3_XS_nextcan) if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) { SvREFCNT_dec(linear_av); SvREFCNT_inc((SV*)cand_cv); - if (!hv_store_ent(nmcache, newSVsv(cachekey), (SV*)cand_cv, 0)) { + if (!hv_store_ent(nmcache, cachekey, (SV*)cand_cv, 0)) { croak("failed to store value in hash"); } XPUSHs(sv_2mortal(newRV_inc((SV*)cand_cv))); @@ -524,7 +524,7 @@ XS(XS_Class_C3_XS_nextcan) } SvREFCNT_dec(linear_av); - if (!hv_store_ent(nmcache, newSVsv(cachekey), &PL_sv_undef, 0)) { + if (!hv_store_ent(nmcache, cachekey, &PL_sv_undef, 0)) { croak("failed to store value in hash"); } if(throw_nomethod)