Skip to content

Commit 43d5a36

Browse files
committed
It's safer to use zval_ptr_dtor() for iterator keys.
1 parent d0a6b10 commit 43d5a36

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/phar/phar_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
14391439
}
14401440

14411441
if (Z_TYPE(key) != IS_STRING) {
1442-
zval_dtor(&key);
1442+
zval_ptr_dtor(&key);
14431443
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
14441444
return ZEND_HASH_APPLY_STOP;
14451445
}
@@ -1567,7 +1567,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
15671567
}
15681568

15691569
if (Z_TYPE(key) != IS_STRING) {
1570-
zval_dtor(&key);
1570+
zval_ptr_dtor(&key);
15711571
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
15721572
return ZEND_HASH_APPLY_STOP;
15731573
}

ext/soap/php_encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
22662266
}
22672267
array_set_zval_key(Z_ARRVAL(array_copy), &key, val);
22682268
zval_ptr_dtor(val);
2269-
zval_dtor(&key);
2269+
zval_ptr_dtor(&key);
22702270
} else {
22712271
add_next_index_zval(&array_copy, val);
22722272
}

0 commit comments

Comments
 (0)