develooper Front page | perl.perl5.porters | Postings from April 2006

[PATCH] perlio.c: false Coverity finding (it cannot see that two pointers are the same): but help Coverity by removing the temp ptr

Thread Next
From:
Jarkko Hietaniemi
Date:
April 11, 2006 13:39
Subject:
[PATCH] perlio.c: false Coverity finding (it cannot see that two pointers are the same): but help Coverity by removing the temp ptr
Message ID:
200604112039.k3BKdWix334525@kosh.hut.fi
--- perlio.c.dist	2006-04-11 23:30:16.000000000 +0300
+++ perlio.c	2006-04-11 23:35:03.000000000 +0300
@@ -2864,7 +2864,6 @@
 #endif
 		stdio = PerlSIO_fopen(path, mode);
 		if (stdio) {
-		    PerlIOStdio *s;
 		    if (!f) {
 			f = PerlIO_allocate(aTHX);
 		    }
@@ -2872,9 +2871,10 @@
 		        mode = PerlIOStdio_mode(mode, tmode);
 		    f = PerlIO_push(aTHX_ f, self, mode, PerlIOArg);
 		    if (f) {
-			s = PerlIOSelf(f, PerlIOStdio);
-			s->stdio = stdio;
-			PerlIOUnix_refcnt_inc(fileno(s->stdio));
+			PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
+			PerlIOUnix_refcnt_inc(fileno(stdio));
+		    } else {
+			PerlSIO_fclose(stdio);
 		    }
 		    return f;
 		}

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About