]> git.baikalelectronics.ru Git - uboot.git/commit
fs/fat: Check malloc return values and fix memory leaks
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Sat, 30 Sep 2017 23:25:22 +0000 (02:25 +0300)
committerTom Rini <trini@konsulko.com>
Sun, 8 Oct 2017 20:19:56 +0000 (16:19 -0400)
commit4af1a86c994d6e58459c801697d5ea4a69c47a43
treea680cc06ac395af2a49a48b5d5107e5de4b084e7
parentd3c291b5318fc8beff9c9c404d5311133f4960ff
fs/fat: Check malloc return values and fix memory leaks

Check malloc() return values and properly unwind on errors so
memory allocated for fat_itr structures get freed properly.

Also fixes a leak of fsdata.fatbuf in fat_size().

Fixes: d32239991fb983 ("fs/fat: Reduce stack usage")
Reported-by: Coverity (CID: 167225, 167233, 167234)
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Tom Rini <trini@konsulko.com>
fs/fat/fat.c