mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Avoid usage of uninitialized data
This commit is contained in:
parent
34723d1b75
commit
3477135cd1
@ -1035,15 +1035,14 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
|
||||
|
||||
if (EXPECTED(key != NULL)) {
|
||||
lc_method_name = Z_STR_P(key);
|
||||
use_heap = 0;
|
||||
} else {
|
||||
STR_ALLOCA_ALLOC(lc_method_name, method_name->len, use_heap);
|
||||
zend_str_tolower_copy(lc_method_name->val, method_name->val, method_name->len);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((func = zend_hash_find(&zobj->ce->function_table, lc_method_name)) == NULL)) {
|
||||
if (UNEXPECTED(!key)) {
|
||||
STR_ALLOCA_FREE(lc_method_name, use_heap);
|
||||
}
|
||||
STR_ALLOCA_FREE(lc_method_name, use_heap);
|
||||
if (zobj->ce->__call) {
|
||||
return zend_get_user_call_function(zobj->ce, method_name);
|
||||
} else {
|
||||
@ -1098,9 +1097,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
|
||||
}
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!key)) {
|
||||
STR_ALLOCA_FREE(lc_method_name, use_heap);
|
||||
}
|
||||
STR_ALLOCA_FREE(lc_method_name, use_heap);
|
||||
return fbc;
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user