Skip to content

Commit c1a80e0

Browse files
committed
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.
1 parent 657a832 commit c1a80e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,11 @@ void zend_shutdown(void) /* {{{ */
10861086
CG(map_ptr_base) = NULL;
10871087
CG(map_ptr_size) = 0;
10881088
}
1089+
if (CG(script_encoding_list)) {
1090+
free(CG(script_encoding_list));
1091+
CG(script_encoding_list) = NULL;
1092+
CG(script_encoding_list_size) = 0;
1093+
}
10891094
#endif
10901095
zend_destroy_rsrc_list_dtors();
10911096
}

0 commit comments

Comments
 (0)