summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-05 02:28:04 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-05 02:28:04 +0000
commit5f6447b607c0041fcf4f5ff536b6919bda7f85b7 (patch)
treebb708ba585a7e05c8df2ec154de79108e18efca7 /sv.c
parentdcb4812c733545a68ef39b77c2dc4f7d440de203 (diff)
downloadperl-5f6447b607c0041fcf4f5ff536b6919bda7f85b7.tar.gz
avoid race condition (storing ptr to SV before incrementing its
REFCNT) and warning in newRV() p4raw-id: //depot/perl@1314
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index f60e8206ca..6e137a3a10 100644
--- a/sv.c
+++ b/sv.c
@@ -3708,10 +3708,7 @@ newRV_noinc(SV *tmpRef)
SV *
newRV(SV *tmpRef)
{
- register SV *sv;
- sv = newRV_noinc(tmpRef);
- SvREFCNT_inc(tmpRef);
- return sv;
+ return newRV_noinc(SvREFCNT_inc(tmpRef));
}
/* make an exact duplicate of old */