Coverity ID: 42: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
* pass1.c (e2fsck_pass1, check_ext_attr),
pass5.c (check_block_bitmaps, check_inode_bitmaps),
- swapfs.c (swap_inodes),
+ pass4.c (e2fsck_pass4), swapfs.c (swap_inodes),
unix.c (parse_extended_opts): Fix memory leaks
2007-03-21 Theodore Tso <tytso@mit.edu>
/* Protect loop from wrap-around if s_inodes_count maxed */
for (i=1; i <= fs->super->s_inodes_count && i > 0; i++) {
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- return;
+ goto errout;
if ((i % fs->super->s_inodes_per_group) == 0) {
group++;
if (ctx->progress)
if ((ctx->progress)(ctx, 4, group, maxgroup))
- return;
+ goto errout;
}
if (i == EXT2_BAD_INO ||
(i > EXT2_ROOT_INO && i < EXT2_FIRST_INODE(fs->super)))
ctx->inode_bb_map = 0;
ext2fs_free_inode_bitmap(ctx->inode_imagic_map);
ctx->inode_imagic_map = 0;
+errout:
if (buf)
ext2fs_free_mem(&buf);
#ifdef RESOURCE_TRACK