tony2001 Sun Mar 19 22:33:10 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/main network.c
Log:
first check stream for NULL, then dereference
http://cvs.php.net/viewcvs.cgi/php-src/main/network.c?r1=1.118.2.1&r2=1.118.2.2&diff_format=u
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.118.2.1 php-src/main/network.c:1.118.2.2
--- php-src/main/network.c:1.118.2.1 Sun Jan 1 12:50:17 2006
+++ php-src/main/network.c Sun Mar 19 22:33:10 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.118.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: network.c,v 1.118.2.2 2006/03/19 22:33:10 tony2001 Exp $ */
/*#define DEBUG_MAIN_NETWORK 1*/
@@ -988,10 +988,12 @@
sock->socket = socket;
stream = php_stream_alloc_rel(&php_stream_generic_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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php