app: aboot: freeing allocated memory when not required
Freeing allocated memory when returning from sparse image flashing.
Change-Id: I62412d144e124d43d4ee4a28c6afed16f3d9f744
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index d689ea6..7f2d1c7 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -2838,6 +2838,7 @@
if (data_end < (uintptr_t)data + sizeof(uint32_t)) {
fastboot_fail("buffer overreads occured due to invalid sparse header");
+ free(fill_buf);
return;
}
fill_val = *(uint32_t *)data;
@@ -2861,6 +2862,7 @@
if ((uint64_t)total_blocks * (uint64_t)sparse_header->blk_sz + sparse_header->blk_sz > size)
{
fastboot_fail("Chunk data size for fill type exceeds partition size");
+ free(fill_buf);
return;
}