From 61a1e8d1574ae11c4432d2d34ae04191aa0a632f Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 12 Feb 2015 16:51:07 +0300 Subject: [PATCH] Fixed initialization of global variables in ZTS (this caused valgrind reports on few PHPT tests) --- ext/standard/file.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 2540c3113e..2d2bb27808 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -156,11 +156,8 @@ static ZEND_RSRC_DTOR_FUNC(file_context_dtor) static void file_globals_ctor(php_file_globals *file_globals_p) { - FG(pclose_ret) = 0; - FG(pclose_wait) = 0; - FG(user_stream_current_filename) = NULL; - FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE; - FG(wrapper_errors) = NULL; + memset(file_globals_p, 0, sizeof(php_file_globals)); + file_globals_p->def_chunk_size = PHP_SOCK_CHUNK_SIZE; } static void file_globals_dtor(php_file_globals *file_globals_p) -- 2.50.1