@@ -441,19 +441,19 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
441
441
* Return FAILURE if input contains any illegal encoding, otherwise SUCCESS.
442
442
*/
443
443
static int
444
- php_mb_parse_encoding_array (HashTable * target_hash , const mbfl_encoding * * * return_list , size_t * return_size , int persistent )
444
+ php_mb_parse_encoding_array (HashTable * target_hash , const mbfl_encoding * * * return_list , size_t * return_size )
445
445
{
446
446
/* Allocate enough space to include the default detect order if "auto" is used. */
447
447
size_t size = zend_hash_num_elements (target_hash ) + MBSTRG (default_detect_order_list_size );
448
- const mbfl_encoding * * list = pecalloc (size , sizeof (mbfl_encoding * ), persistent );
448
+ const mbfl_encoding * * list = ecalloc (size , sizeof (mbfl_encoding * ));
449
449
const mbfl_encoding * * entry = list ;
450
450
zend_bool included_auto = 0 ;
451
451
size_t n = 0 ;
452
452
zval * hash_entry ;
453
453
ZEND_HASH_FOREACH_VAL (target_hash , hash_entry ) {
454
454
zend_string * encoding_str = zval_try_get_string (hash_entry );
455
455
if (UNEXPECTED (!encoding_str )) {
456
- pefree (list , persistent );
456
+ efree (list );
457
457
return FAILURE ;
458
458
}
459
459
@@ -478,7 +478,7 @@ php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encoding ***retur
478
478
php_error_docref (NULL , E_WARNING ,
479
479
"Unknown encoding \"%s\"" , ZSTR_VAL (encoding_str ));
480
480
zend_string_release (encoding_str );
481
- pefree (list , persistent );
481
+ efree (list );
482
482
return FAILURE ;
483
483
}
484
484
}
@@ -1550,7 +1550,7 @@ PHP_FUNCTION(mb_detect_order)
1550
1550
size_t size = 0 ;
1551
1551
switch (Z_TYPE_P (arg1 )) {
1552
1552
case IS_ARRAY :
1553
- if (FAILURE == php_mb_parse_encoding_array (Z_ARRVAL_P (arg1 ), & list , & size , 0 )) {
1553
+ if (FAILURE == php_mb_parse_encoding_array (Z_ARRVAL_P (arg1 ), & list , & size )) {
1554
1554
RETURN_FALSE ;
1555
1555
}
1556
1556
break ;
@@ -2794,7 +2794,7 @@ PHP_FUNCTION(mb_convert_encoding)
2794
2794
}
2795
2795
2796
2796
if (from_encodings_ht ) {
2797
- if (php_mb_parse_encoding_array (from_encodings_ht , & from_encodings , & num_from_encodings , 0 ) == FAILURE ) {
2797
+ if (php_mb_parse_encoding_array (from_encodings_ht , & from_encodings , & num_from_encodings ) == FAILURE ) {
2798
2798
RETURN_FALSE ;
2799
2799
}
2800
2800
free_from_encodings = 1 ;
@@ -2980,7 +2980,7 @@ PHP_FUNCTION(mb_detect_encoding)
2980
2980
2981
2981
/* make encoding list */
2982
2982
if (encoding_ht ) {
2983
- if (FAILURE == php_mb_parse_encoding_array (encoding_ht , & elist , & size , 0 )) {
2983
+ if (FAILURE == php_mb_parse_encoding_array (encoding_ht , & elist , & size )) {
2984
2984
RETURN_FALSE ;
2985
2985
}
2986
2986
free_elist = 1 ;
@@ -3386,7 +3386,7 @@ PHP_FUNCTION(mb_convert_variables)
3386
3386
3387
3387
/* pre-conversion encoding */
3388
3388
if (from_enc_ht ) {
3389
- if (php_mb_parse_encoding_array (from_enc_ht , & elist , & elistsz , 0 ) == FAILURE ) {
3389
+ if (php_mb_parse_encoding_array (from_enc_ht , & elist , & elistsz ) == FAILURE ) {
3390
3390
RETURN_FALSE ;
3391
3391
}
3392
3392
} else {
0 commit comments