Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > d27673e6001a0f733a6f96b690c748b4 > files > 34

php4-4.4.6-3mdv2007.1.src.rpm

--- php-4.4.4/main/network.c.stream-socket-null-deref	2006-11-02 09:29:54.000000000 -0700
+++ php-4.4.4/main/network.c	2006-11-02 09:32:47.000000000 -0700
@@ -638,10 +638,12 @@ PHPAPI php_stream *_php_stream_sock_open
 	sock->socket = socket;
 
 	stream = php_stream_alloc_rel(&php_stream_socket_ops, sock, persistent_id, "r+");
-	stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING;
 
-	if (stream == NULL)	
+	if (stream == NULL) {	
 		pefree(sock, persistent_id ? 1 : 0);
+	} else {
+		stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING;
+	}
 
 	return stream;
 }