Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)

This commit is contained in:
Xinchen Hui 2012-06-01 14:55:14 +08:00
parent fa05f038cb
commit 1f5327a602
2 changed files with 6 additions and 1 deletions

4
NEWS
View File

@ -35,6 +35,10 @@ PHP NEWS
pattern). (Gustavo)
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
- Reflection:
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
with constant). (Laruence)
- XML Writer:
. Fixed bug #62064 (memory leak in the XML Writer module).
(jean-pierre dot lozi at lip6 dot fr)

View File

@ -2420,7 +2420,8 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
*return_value = precv->op2.u.constant;
INIT_PZVAL(return_value);
if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) {
if ((Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT
&& (Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) {
zval_copy_ctor(return_value);
}
zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC);