Skip to content

Commit

Permalink
ext/spl: use zend_object_alloc to create SplObjectStorage instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Feb 15, 2025
1 parent 05a1557 commit 1d70f3c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ext/spl/spl_observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zend
spl_SplObjectStorage *intern;
zend_class_entry *parent = class_type;

intern = emalloc(sizeof(spl_SplObjectStorage) + zend_object_properties_size(parent));
memset(intern, 0, sizeof(spl_SplObjectStorage) - sizeof(zval));
intern = zend_object_alloc(sizeof(spl_SplObjectStorage), parent);
intern->pos = 0;

zend_object_std_init(&intern->std, class_type);
Expand Down

0 comments on commit 1d70f3c

Please sign in to comment.