com php-src: Fixed refcounting (proper fix): Zend/zend_execut e_API.c
| From: | Dmitry Stogov | Date: | Thu, 20 Mar 2014 21:08:26 +0000 |
| Subject: | com php-src: Fixed refcounting (proper fix): Zend/zend_execut e_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77575@lists.php.net to get a copy of this message | ||
Commit: 6123deb30fcd04e3f4c3e7d388705591e44142f9
Author: Dmitry Stogov <dmitry@zend.com> Fri, 21 Mar 2014 01:08:26 +0400
Parents: cce7d5a1eceed880e4d44bc19f644237dc5a3615
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6123deb30fcd04e3f4c3e7d388705591e44142f9
Log:
Fixed refcounting (proper fix)
Changed paths:
M Zend/zend_execute_API.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index b3dc41a..613f4a1 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));