There should been memory leaks(and don't use pointer cast)

This commit is contained in:
Xinchen Hui 2014-05-08 15:20:13 +08:00
parent 5f46c8fa31
commit c242518bf0
3 changed files with 11 additions and 7 deletions

View file

@ -262,7 +262,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
/* If option not found in hash or is not an array -> create array, otherwise add to existing array */
if ((find_arr = zend_hash_find(active_hash, Z_STR_P(arg1))) == NULL || Z_TYPE_P(find_arr) != IS_ARRAY) {
ZVAL_NEW_PERSISTENT_ARR(&option_arr);
zend_hash_init(Z_ARRVAL(option_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1);
zend_hash_init(Z_ARRVAL(option_arr), 8, NULL, config_zval_dtor, 1);
find_arr = zend_hash_update(active_hash, Z_STR_P(arg1), &option_arr);
}
@ -386,7 +386,7 @@ int php_init_config(TSRMLS_D)
int free_ini_search_path = 0;
zend_file_handle fh;
zend_hash_init(&configuration_hash, 8, NULL, (dtor_func_t) config_zval_dtor, 1);
zend_hash_init(&configuration_hash, 8, NULL, config_zval_dtor, 1);
if (sapi_module.ini_defaults) {
sapi_module.ini_defaults(&configuration_hash);