tony2001                Fri Jul 11 12:40:20 2008 UTC

  Modified files:              
    /php-src/main/streams       streams.c 
  Log:
  not all stream wrappers use context, so no need to addref in all cases
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.166&r2=1.167&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.166 
php-src/main/streams/streams.c:1.167
--- php-src/main/streams/streams.c:1.166        Fri Jul 11 10:24:29 2008
+++ php-src/main/streams/streams.c      Fri Jul 11 12:40:20 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.166 2008/07/11 10:24:29 tony2001 Exp $ */
+/* $Id: streams.c,v 1.167 2008/07/11 12:40:20 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -2419,8 +2419,9 @@
                                opened_path, context STREAMS_REL_CC TSRMLS_CC);
                }
 
-               if (context) {
-                       zend_list_addref(context->rsrc_id);
+               /* increase context refcount only if the context is really used 
*/
+               if (stream && stream->context) {
+                       zend_list_addref(stream->context->rsrc_id);
                }
 
                /* if the caller asked for a persistent stream but the wrapper 
did not



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to