summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-02-05 21:47:35 +0000
committerNicholas Clark <nick@ccl4.org>2005-02-05 21:47:35 +0000
commit26866f99b421a0fa48720d3ab1c6664d3cde4a59 (patch)
tree87f8130f816ebebe1ebb001ae0b05fa9db5a495a /util.c
parent558fa1e8b99b11f5445685a5adf1b526ab9c0803 (diff)
downloadperl-26866f99b421a0fa48720d3ab1c6664d3cde4a59.tar.gz
With mallocwrap New() evaluates its arguments more than once, so they
had better not have any side effects. :-( p4raw-id: //depot/perl@23941
Diffstat (limited to 'util.c')
-rw-r--r--util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.c b/util.c
index 85ae19f89f..e90d1955ed 100644
--- a/util.c
+++ b/util.c
@@ -835,7 +835,8 @@ Perl_savesvpv(pTHX_ SV *sv)
const char *pv = SvPV(sv, len);
register char *newaddr;
- New(903,newaddr,++len,char);
+ ++len;
+ New(903,newaddr,len,char);
return CopyD(pv,newaddr,len,char);
}