summaryrefslogtreecommitdiff
path: root/e2fsprogs/ext2fs/rw_bitmaps.c
diff options
context:
space:
mode:
authorRob Landley2006-03-01 16:39:45 +0000
committerRob Landley2006-03-01 16:39:45 +0000
commite7c43b66d74ee9902a6732122788a7a16bcfbf18 (patch)
treeebb8583e9e1265588592614c0b4878daded44125 /e2fsprogs/ext2fs/rw_bitmaps.c
parent93f2286e6e59dab5eed14b5912a79254031c5a62 (diff)
downloadbusybox-e7c43b66d74ee9902a6732122788a7a16bcfbf18.zip
busybox-e7c43b66d74ee9902a6732122788a7a16bcfbf18.tar.gz
Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
Diffstat (limited to 'e2fsprogs/ext2fs/rw_bitmaps.c')
-rw-r--r--e2fsprogs/ext2fs/rw_bitmaps.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/e2fsprogs/ext2fs/rw_bitmaps.c b/e2fsprogs/ext2fs/rw_bitmaps.c
index ae7b6e0..d5698a2 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)
if (retval)
return retval;
if (do_block) {
- if (fs->block_map)
- ext2fs_free_block_bitmap(fs->block_map);
+ ext2fs_free_block_bitmap(fs->block_map);
sprintf(buf, "block bitmap for %s", fs->device_name);
retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
if (retval)
@@ -172,8 +171,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
block_bitmap = fs->block_map->bitmap;
}
if (do_inode) {
- if (fs->inode_map)
- ext2fs_free_inode_bitmap(fs->inode_map);
+ ext2fs_free_inode_bitmap(fs->inode_map);
sprintf(buf, "inode bitmap for %s", fs->device_name);
retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);
if (retval)
@@ -247,14 +245,11 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
cleanup:
if (do_block) {
ext2fs_free_mem(&fs->block_map);
- fs->block_map = 0;
}
if (do_inode) {
ext2fs_free_mem(&fs->inode_map);
- fs->inode_map = 0;
}
- if (buf)
- ext2fs_free_mem(&buf);
+ ext2fs_free_mem(&buf);
return retval;
}