summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2004-06-21 21:08:05 +0000
committerSara Golemon <pollita@php.net>2004-06-21 21:08:05 +0000
commita2c24ae90ead95f8dbed95ff732e6c89bd4275b4 (patch)
tree33f37635e277b9ea2cc75997de9229d66a464814 /ext/standard/basic_functions.c
parentdc66fb1f10518b1c4712fd4d253ab3fb61428080 (diff)
downloadphp-git-a2c24ae90ead95f8dbed95ff732e6c89bd4275b4.tar.gz
BugFix#28868 (Part Two): This fixes thread unsafety in the userspace
filters which relates to the fix just applied for userspace wrappers.
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 970c962848..3f1726c26d 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1163,6 +1163,9 @@ PHP_RINIT_FUNCTION(basic)
/* Default to global wrappers only */
FG(stream_wrappers) = NULL;
+ /* Default to global filters only */
+ FG(stream_filters) = NULL;
+
return SUCCESS;
}
@@ -1186,6 +1189,18 @@ PHP_RSHUTDOWN_FUNCTION(basic)
}
STR_FREE(BG(locale_string));
+ if (FG(stream_wrappers)) {
+ zend_hash_destroy(FG(stream_wrappers));
+ efree(FG(stream_wrappers));
+ FG(stream_wrappers) = NULL;
+ }
+
+ if (FG(stream_filters)) {
+ zend_hash_destroy(FG(stream_filters));
+ efree(FG(stream_filters));
+ FG(stream_filters) = NULL;
+ }
+
PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#ifdef HAVE_SYSLOG_H
PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
@@ -1200,12 +1215,6 @@ PHP_RSHUTDOWN_FUNCTION(basic)
BG(user_tick_functions) = NULL;
}
- if (FG(stream_wrappers)) {
- zend_hash_destroy(FG(stream_wrappers));
- efree(FG(stream_wrappers));
- FG(stream_wrappers) = NULL;
- }
-
PHP_RSHUTDOWN(user_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
return SUCCESS;