Skip to content

Commit

Permalink
Fix minor memory leak of CG(script_encoding_list)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmb69 committed Jul 22, 2020
1 parent 657a832 commit c1a80e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit c1a80e0

Please sign in to comment.