summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-11-14 01:38:31 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-11-14 09:36:17 +0000
commit5c9f2f80687045b87774a34dbc9e34d855fbfd1f (patch)
tree2ced73d95b269436f78e72d5d5176856c98ae22c /regcomp.c
parent542fa716385f08c64e1dc5ef1d9ceacf2ee69d29 (diff)
downloadperl-5c9f2f80687045b87774a34dbc9e34d855fbfd1f.tar.gz
Fwd: Memory leak with s/// and hashes
Message-ID: <9b18b3110611131538kc00175ft4db7ff71df22e766@mail.gmail.com> p4raw-id: //depot/perl@29268
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/regcomp.c b/regcomp.c
index b077ddb1df..9099194b07 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4483,7 +4483,6 @@ reStudy:
Newxz(r->startp, RExC_npar, I32);
Newxz(r->endp, RExC_npar, I32);
- DEBUG_r( RX_DEBUG_on(r) );
DEBUG_DUMP_r({
PerlIO_printf(Perl_debug_log,"Final program:\n");
regdump(r);
@@ -8375,8 +8374,8 @@ Perl_pregfree(pTHX_ struct regexp *r)
DEBUG_COMPILE_r({
if (!PL_colorset)
reginitcolors();
- if (RX_DEBUG(r)){
- SV *dsv= sv_newmortal();
+ {
+ SV *dsv= sv_newmortal();
RE_PV_QUOTED_DECL(s, (r->reganch & ROPT_UTF8),
dsv, r->precomp, r->prelen, 60);
PerlIO_printf(Perl_debug_log,"%sFreeing REx:%s %s\n",
@@ -8485,12 +8484,10 @@ Perl_pregfree(pTHX_ struct regexp *r)
if (trie->nextword)
Safefree(trie->nextword);
#ifdef DEBUGGING
- if (RX_DEBUG(r)) {
- if (trie->words)
- SvREFCNT_dec((SV*)trie->words);
- if (trie->revcharmap)
- SvREFCNT_dec((SV*)trie->revcharmap);
- }
+ if (trie->words)
+ SvREFCNT_dec((SV*)trie->words);
+ if (trie->revcharmap)
+ SvREFCNT_dec((SV*)trie->revcharmap);
#endif
Safefree(r->data->data[n]); /* do this last!!!! */
}