@@ -365,7 +365,7 @@ static int php_mb_parse_encoding_list(const char *value, size_t value_length,
365
365
zend_argument_value_error (arg_num , "contains invalid encoding \"%s\"" , p1 );
366
366
}
367
367
efree (tmpstr );
368
- pefree (list , persistent );
368
+ pefree (ZEND_VOIDP ( list ) , persistent );
369
369
return FAILURE ;
370
370
}
371
371
@@ -400,7 +400,7 @@ static int php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encodi
400
400
ZEND_HASH_FOREACH_VAL (target_hash , hash_entry ) {
401
401
zend_string * encoding_str = zval_try_get_string (hash_entry );
402
402
if (UNEXPECTED (!encoding_str )) {
403
- efree (list );
403
+ efree (ZEND_VOIDP ( list ) );
404
404
return FAILURE ;
405
405
}
406
406
@@ -424,7 +424,7 @@ static int php_mb_parse_encoding_array(HashTable *target_hash, const mbfl_encodi
424
424
} else {
425
425
zend_argument_value_error (arg_num , "contains invalid encoding \"%s\"" , ZSTR_VAL (encoding_str ));
426
426
zend_string_release (encoding_str );
427
- efree (list );
427
+ efree (ZEND_VOIDP ( list ) );
428
428
return FAILURE ;
429
429
}
430
430
}
@@ -809,7 +809,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
809
809
810
810
if (!new_value ) {
811
811
if (MBSTRG (detect_order_list )) {
812
- pefree (MBSTRG (detect_order_list ), 1 );
812
+ pefree (ZEND_VOIDP ( MBSTRG (detect_order_list ) ), 1 );
813
813
}
814
814
MBSTRG (detect_order_list ) = NULL ;
815
815
MBSTRG (detect_order_list_size ) = 0 ;
@@ -821,7 +821,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
821
821
}
822
822
823
823
if (MBSTRG (detect_order_list )) {
824
- pefree (MBSTRG (detect_order_list ), 1 );
824
+ pefree (ZEND_VOIDP ( MBSTRG (detect_order_list ) ), 1 );
825
825
}
826
826
MBSTRG (detect_order_list ) = list ;
827
827
MBSTRG (detect_order_list_size ) = size ;
@@ -836,7 +836,7 @@ static int _php_mb_ini_mbstring_http_input_set(const char *new_value, size_t new
836
836
return FAILURE ;
837
837
}
838
838
if (MBSTRG (http_input_list )) {
839
- pefree (MBSTRG (http_input_list ), 1 );
839
+ pefree (ZEND_VOIDP ( MBSTRG (http_input_list ) ), 1 );
840
840
}
841
841
MBSTRG (http_input_list ) = list ;
842
842
MBSTRG (http_input_list_size ) = size ;
@@ -1128,10 +1128,10 @@ ZEND_TSRMLS_CACHE_UPDATE();
1128
1128
static PHP_GSHUTDOWN_FUNCTION (mbstring )
1129
1129
{
1130
1130
if (mbstring_globals -> http_input_list ) {
1131
- free (mbstring_globals -> http_input_list );
1131
+ free (ZEND_VOIDP ( mbstring_globals -> http_input_list ) );
1132
1132
}
1133
1133
if (mbstring_globals -> detect_order_list ) {
1134
- free (mbstring_globals -> detect_order_list );
1134
+ free (ZEND_VOIDP ( mbstring_globals -> detect_order_list ) );
1135
1135
}
1136
1136
if (mbstring_globals -> http_output_conv_mimetypes ) {
1137
1137
_php_mb_free_regex (mbstring_globals -> http_output_conv_mimetypes );
@@ -1236,7 +1236,7 @@ PHP_RINIT_FUNCTION(mbstring)
1236
1236
PHP_RSHUTDOWN_FUNCTION (mbstring )
1237
1237
{
1238
1238
if (MBSTRG (current_detect_order_list ) != NULL ) {
1239
- efree (MBSTRG (current_detect_order_list ));
1239
+ efree (ZEND_VOIDP ( MBSTRG (current_detect_order_list ) ));
1240
1240
MBSTRG (current_detect_order_list ) = NULL ;
1241
1241
MBSTRG (current_detect_order_list_size ) = 0 ;
1242
1242
}
@@ -1510,13 +1510,13 @@ PHP_FUNCTION(mb_detect_order)
1510
1510
}
1511
1511
1512
1512
if (size == 0 ) {
1513
- efree (list );
1513
+ efree (ZEND_VOIDP ( list ) );
1514
1514
zend_argument_value_error (1 , "must specify at least one encoding" );
1515
1515
RETURN_THROWS ();
1516
1516
}
1517
1517
1518
1518
if (MBSTRG (current_detect_order_list )) {
1519
- efree (MBSTRG (current_detect_order_list ));
1519
+ efree (ZEND_VOIDP ( MBSTRG (current_detect_order_list ) ));
1520
1520
}
1521
1521
MBSTRG (current_detect_order_list ) = list ;
1522
1522
MBSTRG (current_detect_order_list_size ) = size ;
@@ -2632,7 +2632,7 @@ PHP_FUNCTION(mb_convert_encoding)
2632
2632
}
2633
2633
2634
2634
if (!num_from_encodings ) {
2635
- efree (from_encodings );
2635
+ efree (ZEND_VOIDP ( from_encodings ) );
2636
2636
zend_argument_value_error (3 , "must specify at least one encoding" );
2637
2637
RETURN_THROWS ();
2638
2638
}
@@ -2658,7 +2658,7 @@ PHP_FUNCTION(mb_convert_encoding)
2658
2658
}
2659
2659
2660
2660
if (free_from_encodings ) {
2661
- efree (from_encodings );
2661
+ efree (ZEND_VOIDP ( from_encodings ) );
2662
2662
}
2663
2663
}
2664
2664
/* }}} */
@@ -2811,7 +2811,7 @@ PHP_FUNCTION(mb_detect_encoding)
2811
2811
}
2812
2812
2813
2813
if (size == 0 ) {
2814
- efree (elist );
2814
+ efree (ZEND_VOIDP ( elist ) );
2815
2815
zend_argument_value_error (2 , "must specify at least one encoding" );
2816
2816
RETURN_THROWS ();
2817
2817
}
@@ -2826,7 +2826,7 @@ PHP_FUNCTION(mb_detect_encoding)
2826
2826
ret = mbfl_identify_encoding (& string , elist , size , strict );
2827
2827
2828
2828
if (free_elist ) {
2829
- efree (elist );
2829
+ efree (ZEND_VOIDP ( elist ) );
2830
2830
}
2831
2831
2832
2832
if (ret == NULL ) {
@@ -3191,7 +3191,7 @@ PHP_FUNCTION(mb_convert_variables)
3191
3191
}
3192
3192
3193
3193
if (elistsz == 0 ) {
3194
- efree (elist );
3194
+ efree (ZEND_VOIDP ( elist ) );
3195
3195
zend_argument_value_error (2 , "must specify at least one encoding" );
3196
3196
RETURN_THROWS ();
3197
3197
}
@@ -3213,20 +3213,20 @@ PHP_FUNCTION(mb_convert_variables)
3213
3213
from_encoding = mbfl_encoding_detector_judge (identd );
3214
3214
mbfl_encoding_detector_delete (identd );
3215
3215
if (recursion_error ) {
3216
- efree (elist );
3216
+ efree (ZEND_VOIDP ( elist ) );
3217
3217
php_error_docref (NULL , E_WARNING , "Cannot handle recursive references" );
3218
3218
RETURN_FALSE ;
3219
3219
}
3220
3220
}
3221
3221
3222
3222
if (!from_encoding ) {
3223
3223
php_error_docref (NULL , E_WARNING , "Unable to detect encoding" );
3224
- efree (elist );
3224
+ efree (ZEND_VOIDP ( elist ) );
3225
3225
RETURN_FALSE ;
3226
3226
}
3227
3227
}
3228
3228
3229
- efree (elist );
3229
+ efree (ZEND_VOIDP ( elist ) );
3230
3230
3231
3231
convd = mbfl_buffer_converter_new (from_encoding , to_encoding , 0 );
3232
3232
/* If this assertion fails this means some memory allocation failure which is a bug */
@@ -4338,7 +4338,7 @@ static void php_mb_populate_current_detect_order_list(void)
4338
4338
if (MBSTRG (detect_order_list ) && MBSTRG (detect_order_list_size )) {
4339
4339
nentries = MBSTRG (detect_order_list_size );
4340
4340
entry = (const mbfl_encoding * * )safe_emalloc (nentries , sizeof (mbfl_encoding * ), 0 );
4341
- memcpy (entry , MBSTRG (detect_order_list ), sizeof (mbfl_encoding * ) * nentries );
4341
+ memcpy (ZEND_VOIDP ( entry ) , MBSTRG (detect_order_list ), sizeof (mbfl_encoding * ) * nentries );
4342
4342
} else {
4343
4343
const enum mbfl_no_encoding * src = MBSTRG (default_detect_order_list );
4344
4344
size_t i ;
0 commit comments