@@ -3134,7 +3134,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3134
3134
{
3135
3135
HashTable * output , * chash ;
3136
3136
zend_long idx ;
3137
- zend_string * key , * key_tmp ;
3137
+ zend_string * key ;
3138
3138
zval * entry , entry_tmp ;
3139
3139
size_t ckey_len , cval_len ;
3140
3140
char * ckey , * cval ;
@@ -3154,7 +3154,8 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3154
3154
/* convert key */
3155
3155
if (key ) {
3156
3156
ckey = php_mb_convert_encoding (ZSTR_VAL (key ), ZSTR_LEN (key ), _to_encoding , _from_encodings , & ckey_len );
3157
- key_tmp = zend_string_init (ckey , ckey_len , 0 );
3157
+ key = zend_string_init (ckey , ckey_len , 0 );
3158
+ efree (ckey );
3158
3159
}
3159
3160
/* convert value */
3160
3161
ZEND_ASSERT (entry );
@@ -3182,13 +3183,14 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
3182
3183
case IS_OBJECT :
3183
3184
default :
3184
3185
if (key ) {
3185
- efree ( key_tmp );
3186
+ zend_string_release ( key );
3186
3187
}
3187
3188
php_error_docref (NULL , E_WARNING , "Object is not supported" );
3188
3189
continue ;
3189
3190
}
3190
3191
if (key ) {
3191
- zend_hash_add (output , key_tmp , & entry_tmp );
3192
+ zend_hash_add (output , key , & entry_tmp );
3193
+ zend_string_release (key );
3192
3194
} else {
3193
3195
zend_hash_index_add (output , idx , & entry_tmp );
3194
3196
}
0 commit comments