Skip to content

Commit dbea8d3

Browse files
authored
ext/spl: use zend_object_alloc to create SplObjectStorage instances. (#17824)
1 parent 05a1557 commit dbea8d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/spl/spl_observer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zend
257257
spl_SplObjectStorage *intern;
258258
zend_class_entry *parent = class_type;
259259

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

264263
zend_object_std_init(&intern->std, class_type);

0 commit comments

Comments
 (0)