This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a memory leak :
authorYves Orton <demerphq@gmail.com>
Thu, 26 Oct 2006 12:34:43 +0000 (14:34 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 26 Oct 2006 11:02:15 +0000 (11:02 +0000)
Subject: Re: Valgrind findings
Message-ID: <9b18b3110610260334t6b77c2dbu2ca8207d822402da@mail.gmail.com>

p4raw-id: //depot/perl@29111

regexec.c

index c4d88cc..60ec4ff 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3523,7 +3523,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
                         Newx(PL_reg_start_tmp, PL_reg_start_tmpl, char*);
                 }                      
 
-        eval_recurse_doit: /* Share code with RECURSE below this line */                               
+        eval_recurse_doit: /* Share code with RECURSE below this line */
                /* run the pattern returned from (??{...}) */
                ST.cp = regcppush(0);   /* Save *all* the positions. */
                REGCP_SET(ST.lastcp);
@@ -3534,6 +3534,7 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
                *PL_reglastparen = 0;
                *PL_reglastcloseparen = 0;
                PL_reginput = locinput;
+               PL_regsize = 0;
 
                /* XXXX This is too dramatic a measure... */
                PL_reg_maxiter = 0;