From: Xiaoguang Wang Date: Wed, 3 Dec 2014 02:06:40 +0000 (-0500) Subject: tune2fs: fix memory leak in inode_scan_and_fix() X-Git-Tag: v1.42.13~17 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5da8912008bbcfcaef3c8109831fdb4af40cd4fd;p=tools%2Fe2fsprogs.git 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 --- 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; }