mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
bugfix(nvs_flash): fixed potential memory leak in nvs::Storage::init()
This commit is contained in:
committed by
KonstantinKondrashov
parent
416ada0ce1
commit
0eddee63e8
@ -112,12 +112,14 @@ esp_err_t Storage::init(uint32_t baseSector, uint32_t sectorCount)
|
||||
item.getKey(entry->mName, sizeof(entry->mName));
|
||||
err = item.getValue(entry->mIndex);
|
||||
if (err != ESP_OK) {
|
||||
delete entry;
|
||||
return err;
|
||||
}
|
||||
mNamespaces.push_back(entry);
|
||||
if (mNamespaceUsage.set(entry->mIndex, true) != ESP_OK) {
|
||||
delete entry;
|
||||
return ESP_FAIL;
|
||||
}
|
||||
mNamespaces.push_back(entry);
|
||||
itemIndex += item.span;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user