From 1acde2b2776fca4d9386a04909296c2e6b11f242 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 15 Jun 2009 03:53:04 -0400 Subject: [PATCH] dumpe2fs, tune2fs: fix miscellaneous memory leaks Signed-off-by: "Theodore Ts'o" --- misc/dumpe2fs.c | 5 +++++ misc/tune2fs.c | 1 + 2 files changed, 6 insertions(+) diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 61b82f6..64fd9d4 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -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) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 0af116c..2ad3436 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -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); } -- 1.8.3.1