summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-03-21 01:08:26 +0400
committerDmitry Stogov <dmitry@zend.com>2014-03-21 01:08:26 +0400
commit6123deb30fcd04e3f4c3e7d388705591e44142f9 (patch)
tree296e34096ddb20b2187ae97354fc14c410d57644
parentcce7d5a1eceed880e4d44bc19f644237dc5a3615 (diff)
downloadphp-git-6123deb30fcd04e3f4c3e7d388705591e44142f9.tar.gz
Fixed refcounting (proper fix)
-rw-r--r--Zend/zend_execute_API.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index b3dc41ac1a..613f4a1e29 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -623,7 +623,7 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str, str);
}
if (str == str_index->val && len == str_index->len) {
- ZVAL_STR(&const_value, str_index);
+ ZVAL_STR(&const_value, STR_COPY(str_index));
} else {
ZVAL_STRINGL(&const_value, str, len);
}
@@ -640,7 +640,6 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope
switch (Z_TYPE(const_value)) {
case IS_STRING:
- Z_ADDREF(const_value);
ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STR(const_value), HASH_UPDATE_KEY_IF_BEFORE);
break;
case IS_BOOL:
@@ -660,7 +659,7 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope
if (ret == SUCCESS) {
zend_hash_move_forward(Z_ARRVAL_P(p));
}
- zval_ptr_dtor(&const_value);
+ zval_dtor(&const_value);
}
zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));