From 4170b8c32efd2278323cbf945825e6337680b6aa Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 20 Feb 2017 16:02:45 +1100 Subject: [PATCH] partition iterator: Free iterator when reaching end of linked list --- components/spi_flash/partition.c | 1 + 1 file changed, 1 insertion(+) 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);