com php-src: Fix minor memory leak of CG(script_encoding_ list): Zend/zend.c
| From: | Christoph Michael Becker | Date: | Wed, 22 Jul 2020 18:32:48 +0000 |
| Subject: | com php-src: Fix minor memory leak of CG(script_encoding_ list): Zend/zend.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112324@lists.php.net to get a copy of this message | ||
Commit: c1a80e075afd92b269c39f54301510e4d7049a8c
Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 15 Jul 2020 17:17:22 +0200
Parents: 657a832a77d3c0759dce095b619aa16cd5c360ce
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c1a80e075afd92b269c39f54301510e4d7049a8c
Log:
Fix minor memory leak of CG(script_encoding_list)
This only leaks at the end of the process, so per se not an issue, but
the leak is caught by MSVC's CRT leak checker, so we better properly
clean up to avoid false positives.
Changed paths:
M Zend/zend.c
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index 10a678831c..dc1445bf32 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1086,6 +1086,11 @@ void zend_shutdown(void) /* {{{ */
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();
}