av.c apidoc
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index 1a9416e..66d22bc 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2236,7 +2236,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);