summaryrefslogtreecommitdiff
path: root/Zend/zend_hash.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-02-24 18:34:37 +0300
committerDmitry Stogov <dmitry@zend.com>2015-02-24 18:34:37 +0300
commite97ae4fee82e92433207d27843446ee6db0382b1 (patch)
treeb2f891ce7229cfa0d71a4460c66d2738778ff66d /Zend/zend_hash.c
parent26be614400d972b653cdf8dce2bac6c08402b47e (diff)
downloadphp-git-e97ae4fee82e92433207d27843446ee6db0382b1.tar.gz
Make zend_array_destroy() to free the corresponding zend_array
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r--Zend/zend_hash.c6
1 files changed, 4 insertions, 2 deletions
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)