mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix some ZTS issues and leaks
This commit is contained in:
parent
c6eba25571
commit
f449b04713
5 changed files with 10 additions and 3 deletions
|
@ -1149,7 +1149,7 @@ ZEND_FUNCTION(method_exists)
|
|||
&& memcmp(lcname->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0) ? 1 : 0);
|
||||
|
||||
STR_FREE(lcname);
|
||||
STR_FREE(func->common.function_name);
|
||||
STR_RELEASE(func->common.function_name);
|
||||
efree(func);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6864,12 +6864,16 @@ zend_bool zend_is_auto_global(zend_string *name TSRMLS_DC) /* {{{ */
|
|||
int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_auto_global auto_global;
|
||||
int retval;
|
||||
|
||||
auto_global.name = zend_new_interned_string(name TSRMLS_CC);
|
||||
auto_global.auto_global_callback = auto_global_callback;
|
||||
auto_global.jit = jit;
|
||||
|
||||
return zend_hash_add_mem(CG(auto_globals), name, &auto_global, sizeof(zend_auto_global)) != NULL ? SUCCESS : FAILURE;
|
||||
retval = zend_hash_add_mem(CG(auto_globals), name, &auto_global, sizeof(zend_auto_global)) != NULL ? SUCCESS : FAILURE;
|
||||
|
||||
STR_RELEASE(auto_global.name);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
|
@ -697,6 +697,7 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p
|
|||
value = &tmp;
|
||||
} else if (value_type == IS_CONST) {
|
||||
ZVAL_DUP(&tmp, value);
|
||||
value = &tmp;
|
||||
} else if (Z_REFCOUNTED_P(value)) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
|
@ -1107,6 +1108,7 @@ fetch_from_array:
|
|||
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
|
||||
if (type != BP_VAR_UNSET && UNEXPECTED(Z_STRLEN_P(container) == 0)) {
|
||||
convert_to_array:
|
||||
zval_dtor(container);
|
||||
array_init(container);
|
||||
goto fetch_from_array;
|
||||
}
|
||||
|
|
|
@ -1476,7 +1476,6 @@ found:
|
|||
zend_std_call_getter(object, member, &rv TSRMLS_CC);
|
||||
(*guard) &= ~IN_GET;
|
||||
if (Z_TYPE(rv) != IS_UNDEF) {
|
||||
if (Z_REFCOUNTED(rv)) Z_ADDREF(rv);
|
||||
result = i_zend_is_true(&rv TSRMLS_CC);
|
||||
zval_ptr_dtor(&rv);
|
||||
} else {
|
||||
|
|
|
@ -78,6 +78,8 @@ void zend_interned_strings_dtor(TSRMLS_D)
|
|||
zend_hash_destroy(&CG(interned_strings));
|
||||
//??? free(CG(interned_strings).arData);
|
||||
//??? free(CG(interned_strings).arHash);
|
||||
#else
|
||||
free(CG(empty_string));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue