From 8bca073d89a2b87a96f485e60105e51099a3aa28 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 26 Jun 2024 14:24:26 +0800 Subject: [PATCH] em.... fix the wrong fix --- configs/yaf_config_ini.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/configs/yaf_config_ini.c b/configs/yaf_config_ini.c index b8722021..83db1b7e 100644 --- a/configs/yaf_config_ini.c +++ b/configs/yaf_config_ini.c @@ -381,20 +381,15 @@ int yaf_config_ini_init(yaf_config_object *conf, zval *filename, zend_string *se if (zend_parse_ini_file(&fh, 0, 0 /* ZEND_INI_SCANNER_NORMAL */, (zend_ini_parser_cb_t)yaf_config_ini_parser_cb, &configs) == FAILURE || Z_TYPE(configs) != IS_ARRAY) { - zval_ptr_dtor(&configs); -#if PHP_VERSION_ID < 80100 - fclose(fh.handle.fp); -#else - zend_destroy_file_handle(&fh); +#if PHP_VERSION_ID >= 80100 /* zend_parse_ini_file stop dtor filehandle since 8.1 */ + zend_destroy_file_handle(&fh); #endif + zval_ptr_dtor(&configs); yaf_trigger_error(E_ERROR, "Parsing ini file '%s' failed", ini_file); return 0; } -#if PHP_VERSION_ID < 80100 - fclose(fh.handle.fp); -#endif } -#if PHP_VERSION_ID >= 80100 /* zend_stream_ini copy filename from 8.1 */ +#if PHP_VERSION_ID >= 80100 zend_destroy_file_handle(&fh); #endif } else {