From: Gurusamy Sarathy Date: Sun, 5 Jul 1998 02:28:04 +0000 (+0000) Subject: avoid race condition (storing ptr to SV before incrementing its X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f6447b607c0041fcf4f5ff536b6919bda7f85b7;p=p5sagit%2Fp5-mst-13.2.git avoid race condition (storing ptr to SV before incrementing its REFCNT) and warning in newRV() p4raw-id: //depot/perl@1314 --- diff --git a/sv.c b/sv.c index f60e820..6e137a3 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 */