From: Christoph M. Becker Date: Wed, 22 Jul 2020 18:34:21 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1436c4832bc5f76acded56a193e91170464c923;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fix minor memory leak of CG(script_encoding_list) --- f1436c4832bc5f76acded56a193e91170464c923 diff --cc Zend/zend.c index 847fbada4d,dc1445bf32..33d58fd390 --- a/Zend/zend.c +++ b/Zend/zend.c @@@ -1100,11 -1081,16 +1100,16 @@@ void zend_shutdown(void) /* {{{ * ts_free_id(executor_globals_id); ts_free_id(compiler_globals_id); #else - if (CG(map_ptr_base)) { - free(CG(map_ptr_base)); - CG(map_ptr_base) = NULL; + if (ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base))) { + free(ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base))); + ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), NULL); CG(map_ptr_size) = 0; } + if (CG(script_encoding_list)) { + free(CG(script_encoding_list)); + CG(script_encoding_list) = NULL; + CG(script_encoding_list_size) = 0; + } #endif zend_destroy_rsrc_list_dtors(); }