diff options
Diffstat (limited to 'e2fsprogs/ext2fs/rw_bitmaps.c')
-rw-r--r-- | e2fsprogs/ext2fs/rw_bitmaps.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/e2fsprogs/ext2fs/rw_bitmaps.c b/e2fsprogs/ext2fs/rw_bitmaps.c index ae7b6e0cf..d5698a221 100644 --- a/e2fsprogs/ext2fs/rw_bitmaps.c +++ b/e2fsprogs/ext2fs/rw_bitmaps.c | |||
@@ -163,8 +163,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) | |||
163 | if (retval) | 163 | if (retval) |
164 | return retval; | 164 | return retval; |
165 | if (do_block) { | 165 | if (do_block) { |
166 | if (fs->block_map) | 166 | ext2fs_free_block_bitmap(fs->block_map); |
167 | ext2fs_free_block_bitmap(fs->block_map); | ||
168 | sprintf(buf, "block bitmap for %s", fs->device_name); | 167 | sprintf(buf, "block bitmap for %s", fs->device_name); |
169 | retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map); | 168 | retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map); |
170 | if (retval) | 169 | if (retval) |
@@ -172,8 +171,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) | |||
172 | block_bitmap = fs->block_map->bitmap; | 171 | block_bitmap = fs->block_map->bitmap; |
173 | } | 172 | } |
174 | if (do_inode) { | 173 | if (do_inode) { |
175 | if (fs->inode_map) | 174 | ext2fs_free_inode_bitmap(fs->inode_map); |
176 | ext2fs_free_inode_bitmap(fs->inode_map); | ||
177 | sprintf(buf, "inode bitmap for %s", fs->device_name); | 175 | sprintf(buf, "inode bitmap for %s", fs->device_name); |
178 | retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map); | 176 | retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map); |
179 | if (retval) | 177 | if (retval) |
@@ -247,14 +245,11 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) | |||
247 | cleanup: | 245 | cleanup: |
248 | if (do_block) { | 246 | if (do_block) { |
249 | ext2fs_free_mem(&fs->block_map); | 247 | ext2fs_free_mem(&fs->block_map); |
250 | fs->block_map = 0; | ||
251 | } | 248 | } |
252 | if (do_inode) { | 249 | if (do_inode) { |
253 | ext2fs_free_mem(&fs->inode_map); | 250 | ext2fs_free_mem(&fs->inode_map); |
254 | fs->inode_map = 0; | ||
255 | } | 251 | } |
256 | if (buf) | 252 | ext2fs_free_mem(&buf); |
257 | ext2fs_free_mem(&buf); | ||
258 | return retval; | 253 | return retval; |
259 | } | 254 | } |
260 | 255 | ||