]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tune2fs: fix memory leak in inode_scan_and_fix()
authorXiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Wed, 3 Dec 2014 02:06:40 +0000 (21:06 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 3 Dec 2014 02:06:45 +0000 (21:06 -0500)
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 <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index fe2c8ae8b6b93aad613f33eb3b36c3864aacde49..61078ccf3b307456cf8a25598a27829cfe67c9b3 100644 (file)
@@ -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;
 }