From 3b65262922750d2f48e323a385f36d05cf793793 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Thu, 22 Sep 2016 19:50:46 +1000 Subject: [PATCH] Less memory leaks if not coding in a rush... --- components/platform/platform_partition.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/platform/platform_partition.c b/components/platform/platform_partition.c index a03a01ba..523df7e9 100644 --- a/components/platform/platform_partition.c +++ b/components/platform/platform_partition.c @@ -76,7 +76,7 @@ bool platform_partition_add (const platform_partition_t *info) esp_err_t err = spi_flash_read (PARTITION_ADD, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); if (err != ESP_OK) - return false; + goto out; uint8_t idx = 0; for (; possible_idx (idx); ++idx) @@ -99,6 +99,7 @@ bool platform_partition_add (const platform_partition_t *info) PARTITION_ADD, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); } +out: free (part_table); return err == ESP_OK; }