Skip to content

Commit c261f36

Browse files
committed
ext/spl: Guard empty deferred removal list
1 parent 9c3d110 commit c261f36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ext/spl/spl_observer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,9 @@ PHP_METHOD(SplObjectStorage, removeAllExcept)
662662
spl_object_storage_detach(intern, to_remove[i]);
663663
OBJ_RELEASE(to_remove[i]);
664664
}
665-
efree(to_remove);
665+
if (to_remove) {
666+
efree(to_remove);
667+
}
666668

667669
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
668670
intern->index = 0;

0 commit comments

Comments
 (0)