]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 22 Jul 2020 18:34:21 +0000 (20:34 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Wed, 22 Jul 2020 18:34:21 +0000 (20:34 +0200)
* PHP-7.4:
  Fix minor memory leak of CG(script_encoding_list)

1  2 
Zend/zend.c

diff --cc Zend/zend.c
index 847fbada4db08770a3963f01f66727baccfa4a5c,dc1445bf32903ccba758c3d9dada3fbe61c06e13..33d58fd390b2ad620e7744c8171dc77f3d985582
@@@ -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();
  }