@@ -3269,7 +3269,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3269
3269
{
3270
3270
HashTable * output , * chash ;
3271
3271
zend_long idx ;
3272
- zend_string * key , * key_tmp ;
3272
+ zend_string * key ;
3273
3273
zval * entry , entry_tmp ;
3274
3274
size_t ckey_len , cval_len ;
3275
3275
char * ckey , * cval ;
@@ -3289,7 +3289,8 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3289
3289
/* convert key */
3290
3290
if (key ) {
3291
3291
ckey = php_mb_convert_encoding (ZSTR_VAL (key ), ZSTR_LEN (key ), _to_encoding , _from_encodings , & ckey_len );
3292
- key_tmp = zend_string_init (ckey , ckey_len , 0 );
3292
+ key = zend_string_init (ckey , ckey_len , 0 );
3293
+ efree (ckey );
3293
3294
}
3294
3295
/* convert value */
3295
3296
ZEND_ASSERT (entry );
@@ -3317,13 +3318,14 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3317
3318
case IS_OBJECT :
3318
3319
default :
3319
3320
if (key ) {
3320
- efree ( key_tmp );
3321
+ zend_string_release ( key );
3321
3322
}
3322
3323
php_error_docref (NULL , E_WARNING , "Object is not supported" );
3323
3324
continue ;
3324
3325
}
3325
3326
if (key ) {
3326
- zend_hash_add (output , key_tmp , & entry_tmp );
3327
+ zend_hash_add (output , key , & entry_tmp );
3328
+ zend_string_release (key );
3327
3329
} else {
3328
3330
zend_hash_index_add (output , idx , & entry_tmp );
3329
3331
}
0 commit comments