1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

- Fix memleak when scanner is called from within tokenizer extension.

# (only happens with zend multibyte feature enabled)
This commit is contained in:
Moriyoshi Koizumi
2004-03-04 22:50:55 +00:00
parent e5fb0e3fbd
commit c0aabb79b2
+8 -11
View File
@@ -195,6 +195,14 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
#ifdef ZEND_MULTIBYTE
if (SCNG(script_org)) {
efree(SCNG(script_org));
SCNG(script_org) = NULL;
}
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
SCNG(script_org) = lex_state->script_org;
SCNG(script_org_size) = lex_state->script_org_size;
SCNG(script_filtered) = lex_state->script_filtered;
@@ -371,17 +379,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_bailout();
}
compilation_successful=1;
#ifdef ZEND_MULTIBYTE
if (SCNG(script_org)) {
efree(SCNG(script_org));
SCNG(script_org) = NULL;
}
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
#endif /* ZEND_MULTIBYTE */
}
if (retval) {