]> granicus.if.org Git - php/commitdiff
Fixed memory leak (Zend/tests/list_003.phpt)
authorDmitry Stogov <dmitry@zend.com>
Fri, 3 Nov 2017 18:02:27 +0000 (21:02 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 3 Nov 2017 18:02:27 +0000 (21:02 +0300)
Zend/zend_compile.c

index a5dd15f25641d97b2d47ff840a626b5e9a40029e..85d5abb9657173953721543f3aaa6e25f6fef6cc 100644 (file)
@@ -2821,6 +2821,10 @@ static void zend_compile_list_assign(
        zend_bool is_keyed =
                list->children > 0 && list->child[0] != NULL && list->child[0]->child[1] != NULL;
 
+       if (list->children && expr_node->op_type == IS_CONST && Z_TYPE(expr_node->u.constant) == IS_STRING) {
+               zval_make_interned_string(&expr_node->u.constant);
+       }
+
        for (i = 0; i < list->children; ++i) {
                zend_ast *elem_ast = list->child[i];
                zend_ast *var_ast, *key_ast;