Whamcloud - gitweb
dumpe2fs, tune2fs: fix miscellaneous memory leaks
authorTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jun 2009 07:53:04 +0000 (03:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jun 2009 07:55:10 +0000 (03:55 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/dumpe2fs.c
misc/tune2fs.c

index 61b82f6..64fd9d4 100644 (file)
@@ -243,6 +243,10 @@ static void list_desc (ext2_filsys fs)
                        ino_itr += fs->super->s_inodes_per_group;
                }
        }
+       if (block_bitmap)
+               free(block_bitmap);
+       if (inode_bitmap)
+               free(inode_bitmap);
 }
 
 static void list_bad_blocks(ext2_filsys fs, int dump)
@@ -277,6 +281,7 @@ static void list_bad_blocks(ext2_filsys fs, int dump)
        ext2fs_badblocks_list_iterate_end(bb_iter);
        if (!dump)
                fputc('\n', stdout);
+       ext2fs_badblocks_list_free(bb_list);
 }
 
 static void print_inline_journal_information(ext2_filsys fs)
index 0af116c..2ad3436 100644 (file)
@@ -1766,6 +1766,7 @@ retry_open:
                ext2fs_mark_super_dirty(fs);
                printf(_("Setting stripe width to %d\n"), stripe_width);
        }
+       free(device_name);
        remove_error_table(&et_ext2_error_table);
        return (ext2fs_close(fs) ? 1 : 0);
 }