summaryrefslogtreecommitdiff
path: root/Zend/zend_string.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-06 15:44:43 +0200
committerAnatol Belski <ab@php.net>2014-10-06 15:48:55 +0200
commit741bf0ee9626c9342de1175244d9e9e4ad9c69f4 (patch)
treed4042b862a97fea3878a3fc52a50de18355e6c8c /Zend/zend_string.c
parentcc7c14cb76013c8a66b74cfb423135d41a709403 (diff)
downloadphp-git-741bf0ee9626c9342de1175244d9e9e4ad9c69f4.tar.gz
fix the empty_strings SAPI shutdown leak in TS build
still the NTS variant is somewhat different as it needs zend_new_interned_string_int because the normal callbacks might be not initialized, but at least no leaks anymore and some more structure
Diffstat (limited to 'Zend/zend_string.c')
-rw-r--r--Zend/zend_string.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a2fe091695..1833bbd241 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -45,9 +45,9 @@ static void _str_dtor(zval *zv)
void zend_interned_strings_init(TSRMLS_D)
{
+#ifndef ZTS
zend_string *str;
-#ifndef ZTS
zend_hash_init(&CG(interned_strings), 1024, NULL, _str_dtor, 1);
CG(interned_strings).nTableMask = CG(interned_strings).nTableSize - 1;
@@ -59,12 +59,6 @@ void zend_interned_strings_init(TSRMLS_D)
str = zend_string_alloc(sizeof("")-1, 1);
str->val[0] = '\000';
CG(empty_string) = zend_new_interned_string_int(str TSRMLS_CC);
-#else
- str = zend_string_alloc(sizeof("")-1, 1);
- str->val[0] = '\000';
- zend_string_hash_val(str);
- str->gc.u.v.flags |= IS_STR_INTERNED;
- CG(empty_string) = str;
#endif
/* one char strings (the actual interned strings are going to be created by ext/opcache) */
@@ -79,11 +73,6 @@ void zend_interned_strings_dtor(TSRMLS_D)
{
#ifndef ZTS
zend_hash_destroy(&CG(interned_strings));
-#else
- if (NULL != CG(empty_string)) {
- free(CG(empty_string));
- CG(empty_string) = NULL;
- }
#endif
}