Skip to content

Commit 3477135

Browse files
committed
Avoid usage of uninitialized data
1 parent 34723d1 commit 3477135

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Zend/zend_object_handlers.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -1035,15 +1035,14 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
10351035

10361036
if (EXPECTED(key != NULL)) {
10371037
lc_method_name = Z_STR_P(key);
1038+
use_heap = 0;
10381039
} else {
10391040
STR_ALLOCA_ALLOC(lc_method_name, method_name->len, use_heap);
10401041
zend_str_tolower_copy(lc_method_name->val, method_name->val, method_name->len);
10411042
}
10421043

10431044
if (UNEXPECTED((func = zend_hash_find(&zobj->ce->function_table, lc_method_name)) == NULL)) {
1044-
if (UNEXPECTED(!key)) {
1045-
STR_ALLOCA_FREE(lc_method_name, use_heap);
1046-
}
1045+
STR_ALLOCA_FREE(lc_method_name, use_heap);
10471046
if (zobj->ce->__call) {
10481047
return zend_get_user_call_function(zobj->ce, method_name);
10491048
} else {
@@ -1098,9 +1097,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
10981097
}
10991098
}
11001099

1101-
if (UNEXPECTED(!key)) {
1102-
STR_ALLOCA_FREE(lc_method_name, use_heap);
1103-
}
1100+
STR_ALLOCA_FREE(lc_method_name, use_heap);
11041101
return fbc;
11051102
}
11061103
/* }}} */

0 commit comments

Comments
 (0)