Skip to content

Commit 70b7110

Browse files
committed
Current element is already freed in php_phongo_cursor_free()
php_phongo_cursor_iterator_dtor() should not need to free the current element, which is stored on our cursor struct. If the cursor is only used by one iterator, zval_ptr_dtor() on the iterator's intern.data property (i.e. our Cursor zval) will implicitly call the free_object handler, which will invoke php_phongo_cursor_free() and clear the current element.
1 parent f176cb7 commit 70b7110

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

php_phongo.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,6 @@ static void php_phongo_cursor_iterator_dtor(zend_object_iterator *iter TSRMLS_DC
15681568
{
15691569
php_phongo_cursor_iterator *cursor_it = (php_phongo_cursor_iterator *)iter;
15701570

1571-
php_phongo_cursor_free_current(cursor_it->cursor);
1572-
15731571
if (cursor_it->intern.data) {
15741572
zval_ptr_dtor((zval**)&cursor_it->intern.data);
15751573
cursor_it->intern.data = NULL;

0 commit comments

Comments
 (0)