summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 7eafbc05e1..2382afbfb9 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -346,9 +346,12 @@ ZEND_API void destroy_zend_class(zval *zv)
zend_class_constant *c;
ZEND_HASH_FOREACH_PTR(&ce->constants_table, c) {
- zval_internal_ptr_dtor(&c->value);
- if (c->doc_comment && c->ce == ce) {
- zend_string_release(c->doc_comment);
+ if (c->ce == ce) {
+ zval_internal_ptr_dtor(&c->value);
+ if (c->doc_comment) {
+ zend_string_release(c->doc_comment);
+ }
+ free(c);
}
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(&ce->constants_table);