partition iterator: Free iterator when reaching end of linked list

This commit is contained in:
Angus Gratton 2017-02-20 16:02:45 +11:00
parent 902382f622
commit 4170b8c32e

View 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);