Avoid usage of uninitialized data

This commit is contained in:
Dmitry Stogov 2015-01-15 21:08:21 +03:00
parent 34723d1b75
commit 3477135cd1

View File

@ -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;
}
/* }}} */