Skip to content

Commit fdae096

Browse files
committed
Fix memory leak of function attribute hash table
Found while implementing php#7921.
1 parent 05023a2 commit fdae096

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Zend/zend_opcode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ ZEND_API void zend_function_dtor(zval *zv)
153153
ZEND_ASSERT(function->common.function_name);
154154
zend_string_release_ex(function->common.function_name, 1);
155155

156+
if (function->common.attributes) {
157+
zend_hash_destroy(function->common.attributes);
158+
free(function->common.attributes);
159+
function->common.attributes = NULL;
160+
}
161+
156162
/* For methods this will be called explicitly. */
157163
if (!function->common.scope) {
158164
zend_free_internal_arg_info(&function->internal_function);

0 commit comments

Comments
 (0)