From: M. J. T. Guy Date: Fri, 7 Jul 2000 17:57:16 +0000 (+0100) Subject: Re: [ID 20000704.002] [PATCH] memory leak with debug / anon subs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=30987f796262a14f7ed26d8549f6f62a4f3e4ccd;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20000704.002] [PATCH] memory leak with debug / anon subs Message-Id: p4raw-id: //depot/cfgperl@6341 --- diff --git a/pp_hot.c b/pp_hot.c index d45adca..6df5420 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2267,7 +2267,9 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv) && (gv = (GV*)*svp) ))) { /* Use GV from the stack as a fallback. */ /* GV is potentially non-unique, or contain different CV. */ - sv_setsv(dbsv, newRV((SV*)cv)); + SV *tmp = newRV((SV*)cv)); + sv_setsv(dbsv, tmp); + SvREFCNT_dec(tmp); } else { gv_efullname3(dbsv, gv, Nullch);