From: Dmitry Stogov Date: Tue, 22 Mar 2016 21:46:48 +0000 (+0300) Subject: Fixed possible memory leak. X-Git-Tag: php-7.1.0alpha1~428 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc49f8b4383a930cc280a43518e9181ef8fde49c;p=php Fixed possible memory leak. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a8ccc2602c..9b79202014 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3798,6 +3798,10 @@ void zend_compile_global_var(zend_ast *ast) /* {{{ */ zend_op *opline = zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL); opline->extended_value = ZEND_FETCH_GLOBAL_LOCK; + if (name_node.op_type == IS_CONST) { + zend_string_addref(Z_STR(name_node.u.constant)); + } + zend_emit_assign_ref_znode( zend_ast_create(ZEND_AST_VAR, zend_ast_create_znode(&name_node)), &result