Commit 25f4d6d43c5c4825a6a748b44ffa4a9eda3f6acf

Authored by Ye Li
1 parent fed7fbbaea
Exists in emb_lf_v2022.04

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>
(cherry picked from commit bc23ae569c7aaea338648c000b7b733b09eb735a)
(cherry picked from commit 0a496da0851e981b0ab19338145fcb622762af94)
(cherry picked from commit 8386299ae2ab18d02c8d5abc9a82cf4b6deb5e92)
(cherry picked from commit 0a735ce456d3ea9330329b35075f126b49b6987a)
(cherry picked from commit 457edad78dde422fff53efe2358820972e5124a4)

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

... ... @@ -253,6 +253,7 @@
253 253 __func__);
254 254 info->mssg("Request would exceed partition size!",
255 255 response);
  256 + free(fill_buf);
256 257 return -1;
257 258 }
258 259