not all stream wrappers use context, so no need to addref in all cases

This commit is contained in:
Antony Dovgal 2008-07-11 12:40:20 +00:00
parent 5003bfc028
commit ca0a6ec295

View File

@ -2419,8 +2419,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio
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