com php-src: Fix two memory errors by interning earlier: Zend/zend_compile.c
| From: | Nikita Popov | Date: | Sun, 21 Sep 2014 21:56:09 +0000 |
| Subject: | com php-src: Fix two memory errors by interning earlier: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81849@lists.php.net to get a copy of this message | ||
Commit: 7d4c81d8d9cab8b43bbe06692391e6fee554094f
Author: Nikita Popov <nikic@php.net> Sun, 21 Sep 2014 23:56:09 +0200
Parents: a770d29df74515197c76efdf1a64d9794c27b4af
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7d4c81d8d9cab8b43bbe06692391e6fee554094f
Log:
Fix two memory errors by interning earlier
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 1590225..7b80045 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -128,7 +128,7 @@ static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigne
/* NULL, name length, filename length, last accepting char position length */
result = zend_string_alloc(1 + name->len + filename_len + char_pos_len, 0);
sprintf(result->val, "%c%s%s%s", '\0', name->val, filename,
char_pos_buf);
- return result;
+ return zend_new_interned_string(result TSRMLS_CC);
}
/* }}} */
@@ -4864,6 +4864,7 @@ void zend_compile_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
name = zend_prefix_with_ns(name TSRMLS_CC);
+ name = zend_new_interned_string(name TSRMLS_CC);
if (CG(current_import_const)
&& (import_name = zend_hash_find_ptr(CG(current_import_const), name))