Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jffs2: Fix memory leak in jffs2_scan_eraseblock() error path
In jffs2_scan_eraseblock(), 'sumptr' is allocated through kmalloc() if 'sumlen' is larger than 'buf_size'. However, it is not deallocated in the following execution if jffs2_fill_scan_buf() fails, leading to a memory leak bug. To fix this issue, free 'sumptr' before returning the error. Signed-off-by: Wenwen Wang <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
- Loading branch information