From 8aa5082baae0db503b1bfb6876b63a03e5d458fc Mon Sep 17 00:00:00 2001 From: krzychb Date: Tue, 17 Jan 2017 21:20:24 +0100 Subject: [PATCH] Fixed memory leak in example, ref. https://github.com/espressif/esp-idf/issues/209 --- examples/storage/nvs_rw_blob/main/nvs_rw_blob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/storage/nvs_rw_blob/main/nvs_rw_blob.c b/examples/storage/nvs_rw_blob/main/nvs_rw_blob.c index 0d4b7db4ee..c0a865eb6a 100644 --- a/examples/storage/nvs_rw_blob/main/nvs_rw_blob.c +++ b/examples/storage/nvs_rw_blob/main/nvs_rw_blob.c @@ -87,10 +87,10 @@ esp_err_t save_run_time(void) required_size += sizeof(uint32_t); run_time[required_size / sizeof(uint32_t) - 1] = xTaskGetTickCount() * portTICK_PERIOD_MS; err = nvs_set_blob(my_handle, "run_time", run_time, required_size); - if (err != ESP_OK) return err; - free(run_time); + if (err != ESP_OK) return err; + // Commit err = nvs_commit(my_handle); if (err != ESP_OK) return err; -- 2.40.0