Less memory leaks if not coding in a rush...

This commit is contained in:
Johny Mattsson 2016-09-22 19:50:46 +10:00
parent 1f073e8b3f
commit 3b65262922
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,7 @@ bool platform_partition_add (const platform_partition_t *info)
esp_err_t err = esp_err_t err =
spi_flash_read (PARTITION_ADD, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE); spi_flash_read (PARTITION_ADD, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE);
if (err != ESP_OK) if (err != ESP_OK)
return false; goto out;
uint8_t idx = 0; uint8_t idx = 0;
for (; possible_idx (idx); ++idx) 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); PARTITION_ADD, (uint32_t *)part_table, SPI_FLASH_SEC_SIZE);
} }
out:
free (part_table); free (part_table);
return err == ESP_OK; return err == ESP_OK;
} }