Skip to content

Commit 6f5a636

Browse files
committed
Implement more cleanup
1 parent 6d7d812 commit 6f5a636

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/spl/spl_iterators.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,10 @@ zval *spl_iterator_zip_get_current_data(zend_object_iterator *iter)
31123112
data = zend_hash_get_current_data_ex(current->array, &current->hash_position_or_tag);
31133113
}
31143114
if (UNEXPECTED(data == NULL)) {
3115-
// TODO: cleanup the work we already did (and make sure no memory is uninit)
3115+
for (uint32_t j = 0; j < i; j++) {
3116+
zval_ptr_dtor(&array->arPacked[j]);
3117+
ZVAL_UNDEF(&array->arPacked[j]);
3118+
}
31163119
return NULL;
31173120
}
31183121
ZVAL_COPY(&array->arPacked[i], data);

0 commit comments

Comments
 (0)