summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-04-17 13:19:37 +0300
committerNicholas Clark <nick@ccl4.org>2006-04-17 11:37:38 +0000
commit9fdd7463b7e8360d31fec7e9c836e5883fb01a87 (patch)
tree92f39b47c2238b887b86b193ab99738750367951 /doop.c
parent3ce4c5325c6bf80779666a9007ef3a4d29f4fce1 (diff)
downloadperl-9fdd7463b7e8360d31fec7e9c836e5883fb01a87.tar.gz
dooop.c: the strong asserts in Sv* macros could cause memory leakage -- move the macro calls earlier (Coverity CID 84)
Message-Id: <20060417071937.C13346CF2D@aprikoosi.hut.fi> Date: Mon, 17 Apr 2006 10:19:37 +0300 (EEST) p4raw-id: //depot/perl@27859
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/doop.c b/doop.c
index 5972dbd2a6..08b6c230a7 100644
--- a/doop.c
+++ b/doop.c
@@ -1197,6 +1197,8 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
rsave = rc = SvPV_nomg_const(right, rightlen);
len = leftlen < rightlen ? leftlen : rightlen;
lensave = len;
+ SvCUR_set(sv, len);
+ (void)SvPOK_only(sv);
if ((left_utf || right_utf) && (sv == left || sv == right)) {
needlen = optype == OP_BIT_AND ? len : leftlen + rightlen;
Newxz(dc, needlen + 1, char);
@@ -1217,8 +1219,6 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
sv_usepvn_flags(sv, dc, needlen, SV_HAS_TRAILING_NUL);
dc = SvPVX(sv); /* sv_usepvn() calls Renew() */
}
- SvCUR_set(sv, len);
- (void)SvPOK_only(sv);
if (left_utf || right_utf) {
UV duc, luc, ruc;
char *dcorig = dc;