[patch] perl_clone leaks
Doug MacEachern [Wed, 11 Jul 2001 08:43:32 +0000 (01:43 -0700)]
Message-ID: <Pine.LNX.4.21.0107110842390.11688-100000@mako.covalent.net>

p4raw-id: //depot/perl@11280

sv.c

diff --git a/sv.c b/sv.c
index da6bc2b..0f84074 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10189,7 +10189,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
            ENTER;
            SAVETMPS;
            PUSHMARK(SP);
-           XPUSHs(newSVpv(HvNAME(stash), 0));
+           XPUSHs(sv_2mortal(newSVpv(HvNAME(stash), 0)));
            PUTBACK;
            call_sv((SV*)GvCV(cloner), G_DISCARD);
            FREETMPS;
@@ -10197,6 +10197,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
        }
     }
 
+    SvREFCNT_dec(param->stashes);
+    Safefree(param);
+
 #ifdef PERL_OBJECT
     return (PerlInterpreter*)pPerl;
 #else