]> granicus.if.org Git - php/commitdiff
free the right globals
authorAnatol Belski <ab@php.net>
Tue, 16 Dec 2014 08:12:09 +0000 (09:12 +0100)
committerAnatol Belski <ab@php.net>
Tue, 16 Dec 2014 08:12:09 +0000 (09:12 +0100)
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
Zend/zend_ini.c
Zend/zend_ini.h
ext/standard/basic_functions.c

index af323d46f7d32df722253723ef86f9906b9f440f..50c90ede25d984d408ea0288757a17fd49e06672 100644 (file)
@@ -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);
        }
index 1ea635241591a8f3b4acebc70c5afa31ed1198e6..d980d5222ce36781319b8d4bb2dfa82998ad1d2b 100644 (file)
@@ -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;
 }
 /* }}} */
index c60530166164d6bd1ef9ef9bcecd807417ae26db..81a2ee3ef3f64f434ee6e92619a4aea43f6d461e 100644 (file)
@@ -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);
 
index 40869f5ce07679081e0003af0595e85c93c2cc4d..7cae46f29bcebbac2ba7b4e2b40edc2836cee4a5 100644 (file)
@@ -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);
        }
 }
 /* }}} */