From 2b9b9afa7a9a66f9c80013ce4121183bdff434e8 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 17 Feb 2014 17:59:18 +0400 Subject: Use better data structures (incomplete) --- main/php_ini.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'main/php_ini.c') diff --git a/main/php_ini.c b/main/php_ini.c index 118743fba3..cb68d83e65 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -193,9 +193,9 @@ PHPAPI void config_zval_dtor(zval *zvalue) { if (Z_TYPE_P(zvalue) == IS_ARRAY) { zend_hash_destroy(Z_ARRVAL_P(zvalue)); - free(Z_ARRVAL_P(zvalue)); + free(Z_ARR_P(zvalue)); } else if (Z_TYPE_P(zvalue) == IS_STRING) { - free(Z_STRVAL_P(zvalue)); + STR_RELEASE(Z_STR_P(zvalue)); } } /* Reset / free active_ini_sectin global */ @@ -591,8 +591,6 @@ int php_init_config(TSRMLS_D) zval tmp; ZVAL_STR(&tmp, STR_INIT(fh.filename, strlen(fh.filename), 1)); - Z_SET_REFCOUNT(tmp, 0); - zend_hash_str_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path")-1, &tmp); if (php_ini_opened_path) { efree(php_ini_opened_path); -- cgit v1.2.1