summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_execute.c1
-rw-r--r--Zend/zend_hash.c6
-rw-r--r--Zend/zend_objects.c1
-rw-r--r--Zend/zend_opcode.c1
-rw-r--r--Zend/zend_variables.c2
5 files changed, 4 insertions, 7 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 00a68613fc..9e3d9f10d1 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1694,7 +1694,6 @@ ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /* {{{
{
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
zend_array_destroy(symbol_table);
- efree_size(symbol_table, sizeof(zend_array));
} else {
/* clean before putting into the cache, since clean
could call dtors, which could use cached hash */
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 96e8cb2788..afc8f9b546 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1113,7 +1113,7 @@ ZEND_API void zend_array_destroy(HashTable *ht)
/* In some rare cases destructors of regular arrays may be changed */
if (UNEXPECTED(ht->pDestructor != ZVAL_PTR_DTOR)) {
zend_hash_destroy(ht);
- return;
+ goto free_ht;
}
p = ht->arData;
@@ -1139,9 +1139,11 @@ ZEND_API void zend_array_destroy(HashTable *ht)
zend_hash_iterators_remove(ht);
SET_INCONSISTENT(HT_DESTROYED);
} else if (EXPECTED(!(ht->u.flags & HASH_FLAG_INITIALIZED))) {
- return;
+ goto free_ht;
}
pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
+free_ht:
+ FREE_HASHTABLE(ht);
}
ZEND_API void zend_hash_clean(HashTable *ht)
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 60e446b4fd..aec3811087 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -55,7 +55,6 @@ ZEND_API void zend_object_std_dtor(zend_object *object)
if (object->properties) {
zend_array_destroy(object->properties);
- FREE_HASHTABLE(object->properties);
}
count = object->ce->default_properties_count;
for (i = 0; i < count; i++) {
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 9e79697589..6c3483a250 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -322,7 +322,6 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
!(GC_FLAGS(op_array->static_variables) & IS_ARRAY_IMMUTABLE)) {
if (--GC_REFCOUNT(op_array->static_variables) == 0) {
zend_array_destroy(op_array->static_variables);
- FREE_HASHTABLE(op_array->static_variables);
}
}
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index de0fa1285b..2f0c403143 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -46,7 +46,6 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
zend_array_destroy(arr);
- efree_size(arr, sizeof(zend_array));
break;
}
case IS_CONSTANT_AST: {
@@ -102,7 +101,6 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
zend_array_destroy(arr);
- efree_size(arr, sizeof(zend_array));
break;
}
case IS_CONSTANT_AST: {