Skip to content

Commit f4323f8

Browse files
committed
Fix mem leak when opcache is not enabled
1 parent 9239a90 commit f4323f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Zend/zend_language_scanner.l

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
683683
ZEND_API zend_op_array *zend_compile_ast(
684684
zend_ast *ast, int type, zend_string *filename)
685685
{
686+
zend_string *original_compiled_filename = CG(compiled_filename);
686687
bool original_in_compilation = CG(in_compilation);
687688
CG(in_compilation) = 1;
688689
CG(ast) = ast;
@@ -691,6 +692,7 @@ ZEND_API zend_op_array *zend_compile_ast(
691692
zend_op_array *op_array = zend_compile_ast_internal(type);
692693

693694
CG(in_compilation) = original_in_compilation;
695+
zend_restore_compiled_filename(original_compiled_filename);
694696

695697
return op_array;
696698
}

0 commit comments

Comments
 (0)