]> granicus.if.org Git - esp-idf/commitdiff
partition iterator: Free iterator when reaching end of linked list
authorAngus Gratton <angus@espressif.com>
Mon, 20 Feb 2017 05:02:45 +0000 (16:02 +1100)
committerAngus Gratton <angus@espressif.com>
Tue, 21 Feb 2017 23:26:04 +0000 (10:26 +1100)
components/spi_flash/partition.c

index 58153cd7f0058fbd90fec6ef02b0bcb7c0ef719b..89ad9807e92a452e13a47a589b28e0b5297f2a57 100644 (file)
@@ -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);