From 5da8912008bbcfcaef3c8109831fdb4af40cd4fd Mon Sep 17 00:00:00 2001 From: Xiaoguang Wang Date: Tue, 2 Dec 2014 21:06:40 -0500 Subject: [PATCH] tune2fs: fix memory leak in inode_scan_and_fix() When we use ext2fs_open_inode_scan() to iterate inodes and finish jobs, we also need a ext2fs_close_inode_scan(scan) operation, but in inode_scan_and_fix(), we forgot to call it, fix this error. Signed-off-by: Xiaoguang Wang Reviewed-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- misc/tune2fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index fe2c8ae..61078cc 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1603,6 +1603,7 @@ static int inode_scan_and_fix(ext2_filsys fs, ext2fs_block_bitmap bmap) err_out: ext2fs_free_mem(&block_buf); + ext2fs_close_inode_scan(scan); return retval; } -- 1.8.3.1