summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-10-05 21:51:54 +0000
committerNicholas Clark <nick@ccl4.org>2008-10-05 21:51:54 +0000
commit45cf45700e1f870b69e32588ff8b7583510f7b6b (patch)
tree454a7b02cdbad7c23df3266bbdb97aae359a009c /regcomp.c
parent9be01f29fa8229b0cb279cd26191f322dbf0ae2a (diff)
downloadperl-45cf45700e1f870b69e32588ff8b7583510f7b6b.tar.gz
Avoid allocating 1 extra regnode when duplicating a regexp.
See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00590.html and http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-10/msg00163.html p4raw-id: //depot/perl@34464
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index d2567d0157..54347cca6e 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9625,7 +9625,7 @@ Perl_regdupe_internal(pTHX_ REGEXP * const rx, CLONE_PARAMS *param)
npar = r->nparens+1;
len = ProgLen(ri);
- Newxc(reti, sizeof(regexp_internal) + (len+1)*sizeof(regnode), char, regexp_internal);
+ Newxc(reti, sizeof(regexp_internal) + len*sizeof(regnode), char, regexp_internal);
Copy(ri->program, reti->program, len+1, regnode);