com php-src: free the right globals: Zend/zend.c Zend/zend_in i.c Zend/zend_ini.h ext/standard/basic_functions. c
| From: | Anatol Belski | Date: | Tue, 16 Dec 2014 08:12:09 +0000 |
| Subject: | com php-src: free the right globals: Zend/zend.c Zend/zend_in i.c Zend/zend_ini.h ext/standard/basic_functions. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83730@lists.php.net to get a copy of this message | ||
Commit: eb629b70da620fcdac6aca472c1450824ded15de
Author: Anatol Belski <ab@php.net> Tue, 16 Dec 2014 09:12:09 +0100
Parents: 50a93357fb748ee1976fb7993abccae9c8105157
Branches: native-tls
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eb629b70da620fcdac6aca472c1450824ded15de
Log:
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.
Changed paths:
M Zend/zend.c
M Zend/zend_ini.c
M Zend/zend_ini.h
M ext/standard/basic_functions.c
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index af323d4..50c90ed 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 1ea6352..d980d52 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 c605301..81a2ee3 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 40869f5..7cae46f 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);
}
}
/* }}} */