diff options
| author | Antony Dovgal <tony2001@php.net> | 2008-07-11 12:40:20 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2008-07-11 12:40:20 +0000 |
| commit | ca0a6ec295f54504f657ef5678ee6c4d6bbcbff0 (patch) | |
| tree | 6fbbdebac368f4e50e097abe7ef211cb9fa7e68a /main/streams/streams.c | |
| parent | 5003bfc02851c0368062d30f3cb9f99d542684d6 (diff) | |
| download | php-git-ca0a6ec295f54504f657ef5678ee6c4d6bbcbff0.tar.gz | |
not all stream wrappers use context, so no need to addref in all cases
Diffstat (limited to 'main/streams/streams.c')
| -rwxr-xr-x | main/streams/streams.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index fe7f0ff915..f1b74a49d5 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -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 |
