Skip to content

Commit

Permalink
tune2fs: fix memory leak in inode_scan_and_fix()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wangxiaoguang authored and tytso committed Dec 3, 2014
1 parent e684769 commit 5da8912
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions misc/tune2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5da8912

Please sign in to comment.