Skip to content

Commit b2c92ad

Browse files
author
Christian Schneider
committed
Fix memory leak when doc comments are present before and after the parameter
1 parent 0b06250 commit b2c92ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Zend/zend_language_parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ optional_cpp_modifiers:
818818
parameter:
819819
optional_cpp_modifiers optional_type_without_static
820820
is_reference is_variadic T_VARIABLE backup_doc_comment optional_property_hook_list backup_doc_comment
821-
{ $$ = zend_ast_create_ex(ZEND_AST_PARAM, $1 | $3 | $4, $2, $5, NULL,
821+
{ if ($6 && $8) { zend_string_release_ex($6, 0); }; $$ = zend_ast_create_ex(ZEND_AST_PARAM, $1 | $3 | $4, $2, $5, NULL,
822822
NULL, $8 ? zend_ast_create_zval_from_str($8) : ($6 ? zend_ast_create_zval_from_str($6) : NULL), $7); }
823823
| optional_cpp_modifiers optional_type_without_static
824824
is_reference is_variadic T_VARIABLE backup_doc_comment '=' expr optional_property_hook_list backup_doc_comment

0 commit comments

Comments
 (0)