Skip to content

Commit d9e7129

Browse files
committed
Use zend_new_array() for HashTable exposed to userspace
1 parent 64cff0b commit d9e7129

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎ext/mbstring/mbstring.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,8 +3570,7 @@ PHP_FUNCTION(mb_list_encodings)
35703570
/* Initialize shared array of supported encoding names
35713571
* This is done so that we can check if `mb_list_encodings()` is being
35723572
* passed to other mbstring functions using a cheap pointer equality check */
3573-
HashTable *array = emalloc(sizeof(HashTable));
3574-
zend_hash_init(array, 80, NULL, zval_ptr_dtor_str, false);
3573+
HashTable *array = zend_new_array(80);
35753574
for (const mbfl_encoding **encodings = mbfl_get_supported_encodings(); *encodings; encodings++) {
35763575
zval tmp;
35773576
ZVAL_STRING(&tmp, (*encodings)->name);

0 commit comments

Comments
 (0)