diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index f82a3ffe91e9..0daf486e40b6 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1191,6 +1191,7 @@ PHP_METHOD(SplDoublyLinkedList, add) /* Get the element we want to insert before */ element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); + ZEND_ASSERT(element != NULL); ZVAL_COPY(&elem->data, value); SPL_LLIST_RC(elem) = 1;