Plug a memory leak in newCONSTSUB
Rafael Garcia-Suarez [Wed, 25 Oct 2006 13:51:55 +0000 (13:51 +0000)]
p4raw-id: //depot/perl@29107

op.c

diff --git a/op.c b/op.c
index 66d3734..5b0c3fc 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5453,6 +5453,7 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv)
     cv = newXS_flags(name, const_sv_xsub, file, "", XS_DYNAMIC_FILENAME);
     CvXSUBANY(cv).any_ptr = sv;
     CvCONST_on(cv);
+    Safefree(file);
 
 #ifdef USE_ITHREADS
     if (stash)