diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-04-17 13:19:37 +0300 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-17 11:37:38 +0000 |
commit | 9fdd7463b7e8360d31fec7e9c836e5883fb01a87 (patch) | |
tree | 92f39b47c2238b887b86b193ab99738750367951 /doop.c | |
parent | 3ce4c5325c6bf80779666a9007ef3a4d29f4fce1 (diff) | |
download | perl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |