Skip to content

Commit 764f7ba

Browse files
committed
xml: Avoid copying function name string
The function name lives for the entire request, so no need to make a copy.
1 parent 6ae0d25 commit 764f7ba

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ext/xml/xml.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,16 +1178,14 @@ static bool php_xml_check_string_method_arg(
11781178
&& parser_to_check->fcc_field.object == parser_to_check->object \
11791179
&& parser_to_check->fcc_field.calling_scope == NULL \
11801180
) { \
1181-
zend_string *method_name = zend_string_copy(parser_to_check->fcc_field.function_handler->common.function_name); \
1181+
zend_string *method_name = parser_to_check->fcc_field.function_handler->common.function_name; \
11821182
zend_fcc_dtor(&parser_to_check->fcc_field); \
11831183
bool status = php_xml_check_string_method_arg(0, new_this_obj, method_name, &parser_to_check->fcc_field); \
11841184
if (status == false) { \
11851185
zend_argument_value_error(2, "cannot safely swap to object of class %s as method \"%s\" does not exist, which was set via " handler_set_method, \
11861186
ZSTR_VAL(new_this_obj->ce->name), ZSTR_VAL(method_name)); \
1187-
zend_string_release(method_name); \
11881187
RETURN_THROWS(); \
11891188
} \
1190-
zend_string_release(method_name); \
11911189
zend_fcc_addref(&parser_to_check->fcc_field); \
11921190
}
11931191

0 commit comments

Comments
 (0)