tony2001                Sun Mar 19 22:34:26 2006 UTC

  Modified files:              
    /php-src/main       network.c 
  Log:
  MFB: first check stream for NULL, then dereference
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/network.c?r1=1.120&r2=1.121&diff_format=u
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.120 php-src/main/network.c:1.121
--- php-src/main/network.c:1.120        Sun Feb 19 04:29:41 2006
+++ php-src/main/network.c      Sun Mar 19 22:34:26 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: network.c,v 1.120 2006/02/19 04:29:41 andi Exp $ */
+/* $Id: network.c,v 1.121 2006/03/19 22:34:26 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

Reply via email to