diff options
| -rw-r--r-- | ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt | 4 | ||||
| -rwxr-xr-x | main/streams/streams.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt b/ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt index fff5c746f8..8b5293a48f 100644 --- a/ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt +++ b/ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt @@ -2,6 +2,10 @@ ReflectionExtension::getDependencies() method on an extension with a required and conflicting dependency --CREDITS-- Felix De Vliegher <felix.devliegher@gmail.com> +--SKIPIF-- +<?php +if (!extension_loaded("dom")) die("skip no dom extension"); +?> --FILE-- <?php $dom = new ReflectionExtension('dom'); diff --git a/main/streams/streams.c b/main/streams/streams.c index 14bbcd2657..118c537648 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1806,8 +1806,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 |
