From: Nikita Popov Date: Sun, 12 Oct 2014 17:01:45 +0000 (+0200) Subject: Fix invalid zend_string_frees in reflection X-Git-Tag: POST_NATIVE_TLS_MERGE^2~75^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4ab08ac9d7a407f4b2ab43790cd0eae738615c6;p=php Fix invalid zend_string_frees in reflection zend_lookup_class can share the name --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7291d64213..57e11945c1 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2402,7 +2402,7 @@ ZEND_METHOD(reflection_parameter, getClass) } else { zend_string *name = zend_string_init(param->arg_info->class_name, param->arg_info->class_name_len, 0); ce = zend_lookup_class(name TSRMLS_CC); - zend_string_free(name); + zend_string_release(name); if (!ce) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not exist", param->arg_info->class_name); @@ -3862,10 +3862,10 @@ ZEND_METHOD(reflection_class, getProperty) if (!EG(exception)) { zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", classname->val); } - zend_string_free(classname); + zend_string_release(classname); return; } - zend_string_free(classname); + zend_string_release(classname); if (!instanceof_function(ce, ce2 TSRMLS_CC)) { zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Fully qualified property name %s::%s does not specify a base class of %s", ce2->name->val, str_name, ce->name->val);