From eb629b70da620fcdac6aca472c1450824ded15de Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 16 Dec 2014 09:12:09 +0100 Subject: [PATCH] free the right globals That's the same as in the previous commit. In the TS mode the tsrm cache pointer might be unavailable or point to a wrong thread, so the exact globals passed should be freed. --- Zend/zend.c | 2 +- Zend/zend_ini.c | 6 +++--- Zend/zend_ini.h | 2 +- ext/standard/basic_functions.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index af323d46f7..50c90ede25 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -487,7 +487,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{ static void executor_globals_dtor(zend_executor_globals *executor_globals) /* {{{ */ { - zend_ini_shutdown(); + zend_ini_shutdown(executor_globals->ini_directives); if (&executor_globals->persistent_list != global_persistent_list) { zend_destroy_rsrc_list(&executor_globals->persistent_list); } diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 1ea6352415..d980d5222c 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -114,10 +114,10 @@ ZEND_API int zend_ini_startup(void) /* {{{ */ } /* }}} */ -ZEND_API int zend_ini_shutdown(void) /* {{{ */ +ZEND_API int zend_ini_shutdown(HashTable *ini_directives) /* {{{ */ { - zend_hash_destroy(EG(ini_directives)); - free(EG(ini_directives)); + zend_hash_destroy(ini_directives); + free(ini_directives); return SUCCESS; } /* }}} */ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index c605301661..81a2ee3ef3 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -62,7 +62,7 @@ struct _zend_ini_entry { BEGIN_EXTERN_C() ZEND_API int zend_ini_startup(void); -ZEND_API int zend_ini_shutdown(void); +ZEND_API int zend_ini_shutdown(HashTable *ini_directives); ZEND_API int zend_ini_global_shutdown(void); ZEND_API int zend_ini_deactivate(void); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 40869f5ce0..7cae46f29b 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3452,9 +3452,9 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */ static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */ { - if (BG(url_adapt_state_ex).tags) { - zend_hash_destroy(BG(url_adapt_state_ex).tags); - free(BG(url_adapt_state_ex).tags); + if (basic_globals_p->url_adapt_state_ex.tags) { + zend_hash_destroy(basic_globals_p->url_adapt_state_ex.tags); + free(basic_globals_p->url_adapt_state_ex.tags); } } /* }}} */ -- 2.40.0