Skip to content

Commit c76604d

Browse files
bwoebiTimWolla
authored andcommitted
Fix freeing of internal attribute arguments
1 parent 5b54da8 commit c76604d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Zend/zend_attributes.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *
205205
static void attr_free(zval *v)
206206
{
207207
zend_attribute *attr = Z_PTR_P(v);
208+
bool persistent = attr->flags & ZEND_ATTRIBUTE_PERSISTENT;
208209

209210
zend_string_release(attr->name);
210211
zend_string_release(attr->lcname);
@@ -213,10 +214,14 @@ static void attr_free(zval *v)
213214
if (attr->args[i].name) {
214215
zend_string_release(attr->args[i].name);
215216
}
216-
zval_ptr_dtor(&attr->args[i].value);
217+
if (persistent) {
218+
zval_internal_ptr_dtor(&attr->args[i].value);
219+
} else {
220+
zval_ptr_dtor(&attr->args[i].value);
221+
}
217222
}
218223

219-
pefree(attr, attr->flags & ZEND_ATTRIBUTE_PERSISTENT);
224+
pefree(attr, persistent);
220225
}
221226

222227
ZEND_API zend_attribute *zend_add_attribute(HashTable **attributes, zend_string *name, uint32_t argc, uint32_t flags, uint32_t offset, uint32_t lineno)

0 commit comments

Comments
 (0)