Opcode.XS, fix memory leak
authorCharles Lane <lane@DUPHY4.Physics.Drexel.Edu>
Wed, 10 Jan 2001 13:23:02 +0000 (08:23 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 10 Jan 2001 18:42:08 +0000 (18:42 +0000)
Message-Id: <010110132245.8129a@DUPHY4.Physics.Drexel.Edu>

p4raw-id: //depot/perl@8390

ext/Opcode/Opcode.xs

index 04f7c3f..d437cd7 100644 (file)
@@ -271,6 +271,7 @@ PPCODE:
 
     /* %INC must be clean for use/require in compartment */
     save_hash(PL_incgv);
+    sv_free((SV*)GvHV(PL_incgv));  /* get rid of what save_hash gave us*/
     GvHV(PL_incgv) = (HV*)SvREFCNT_inc(GvHV(gv_HVadd(gv_fetchpv("INC",TRUE,SVt_PVHV))));
 
     PUSHMARK(SP);