Skip to content

Commit e6d031c

Browse files
committed
ext/xml: Use zend_hash_lookup
1 parent bb5e2fa commit e6d031c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

ext/xml/xml.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,11 @@ 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_lookup(arr, name)) == NULL) {
558-
zval values;
559-
array_init(&values);
560-
element = zend_hash_add(arr, name, &values);
557+
element = zend_hash_lookup(arr, name);
558+
559+
if (Z_TYPE_P(element) == IS_NULL) {
560+
561+
array_init(element);
561562
}
562563

563564
add_next_index_long(element, parser->curtag);

0 commit comments

Comments
 (0)