Skip to content

Commit e5f9650

Browse files
authored
ext/xml: Use zend_hash_lookup() for missing array keys (#21536)
1 parent a2c9606 commit e5f9650

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/xml/xml.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,10 @@ static void xml_add_to_info(xml_parser *parser, zend_string *name)
554554
SEPARATE_ARRAY(Z_REFVAL(parser->info));
555555
zend_array *arr = Z_ARRVAL_P(Z_REFVAL(parser->info));
556556

557-
if ((element = zend_hash_find(arr, name)) == NULL) {
558-
zval values;
559-
array_init(&values);
560-
element = zend_hash_update(arr, name, &values);
557+
element = zend_hash_lookup(arr, name);
558+
559+
if (Z_TYPE_P(element) == IS_NULL) {
560+
array_init(element);
561561
}
562562

563563
add_next_index_long(element, parser->curtag);

0 commit comments

Comments
 (0)