diff --git a/components/spi_flash/partition.c b/components/spi_flash/partition.c index 58153cd7f0..89ad9807e9 100644 --- a/components/spi_flash/partition.c +++ b/components/spi_flash/partition.c @@ -85,6 +85,7 @@ esp_partition_iterator_t esp_partition_next(esp_partition_iterator_t it) assert(it); // iterator reached the end of linked list? if (it->next_item == NULL) { + esp_partition_iterator_release(it); return NULL; } _lock_acquire(&s_partition_list_lock);