From cbf3240d912bef144159dec3d211554c6f89116a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 9 Apr 2021 21:12:16 +0200 Subject: [PATCH] Don't report leak on unclean_shutdown during startup In particular if an invalid ini option is specified. --- main/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/main.c b/main/main.c index 5845404d43f..632e9b646fb 100644 --- a/main/main.c +++ b/main/main.c @@ -2322,7 +2322,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod /* Don't leak errors from startup into the per-request phase. */ clear_last_error(); - shutdown_memory_manager(!PG(report_memleaks), 0); + shutdown_memory_manager(!PG(report_memleaks) || CG(unclean_shutdown), 0); virtual_cwd_activate(); zend_interned_strings_switch_storage(1);