@@ -3269,7 +3269,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
32693269{
32703270 HashTable * output , * chash ;
32713271 zend_long idx ;
3272- zend_string * key , * key_tmp ;
3272+ zend_string * key ;
32733273 zval * entry , entry_tmp ;
32743274 size_t ckey_len , cval_len ;
32753275 char * ckey , * cval ;
@@ -3289,7 +3289,8 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
32893289 /* convert key */
32903290 if (key ) {
32913291 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 );
32933294 }
32943295 /* convert value */
32953296 ZEND_ASSERT (entry );
@@ -3317,13 +3318,14 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
33173318 case IS_OBJECT :
33183319 default :
33193320 if (key ) {
3320- efree ( key_tmp );
3321+ zend_string_release ( key );
33213322 }
33223323 php_error_docref (NULL , E_WARNING , "Object is not supported" );
33233324 continue ;
33243325 }
33253326 if (key ) {
3326- zend_hash_add (output , key_tmp , & entry_tmp );
3327+ zend_hash_add (output , key , & entry_tmp );
3328+ zend_string_release (key );
33273329 } else {
33283330 zend_hash_index_add (output , idx , & entry_tmp );
33293331 }
0 commit comments