partition iterator: Free iterator when reaching end of linked list

pull/407/head
Angus Gratton 2017-02-20 16:02:45 +11:00
rodzic 902382f622
commit 4170b8c32e
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -85,6 +85,7 @@ esp_partition_iterator_t esp_partition_next(esp_partition_iterator_t it)
assert(it); assert(it);
// iterator reached the end of linked list? // iterator reached the end of linked list?
if (it->next_item == NULL) { if (it->next_item == NULL) {
esp_partition_iterator_release(it);
return NULL; return NULL;
} }
_lock_acquire(&s_partition_list_lock); _lock_acquire(&s_partition_list_lock);