Commit bc23ae569c7aaea338648c000b7b733b09eb735a

Authored by Ye Li
1 parent bc1550557f

MLK-20356-1 common: Fix resource leak in sparse image writting

Fix coverity issue CID 18031: Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fill_buf going out of scope leaks the storage it points to

Should free the fill_buf before function return.

Signed-off-by: Ye Li <ye.li@nxp.com>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

common/image-sparse.c
... ... @@ -200,6 +200,7 @@
200 200 __func__);
201 201 fastboot_fail(
202 202 "Request would exceed partition size!");
  203 + free(fill_buf);
203 204 return;
204 205 }
205 206