summaryrefslogtreecommitdiffhomepage
path: root/e2fsprogs/ext2fs/irel_ma.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-01 16:39:45 +0000
committerRob Landley <rob@landley.net>2006-03-01 16:39:45 +0000
commite7c43b66d74ee9902a6732122788a7a16bcfbf18 (patch)
treeebb8583e9e1265588592614c0b4878daded44125 /e2fsprogs/ext2fs/irel_ma.c
parent93f2286e6e59dab5eed14b5912a79254031c5a62 (diff)
Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
Diffstat (limited to 'e2fsprogs/ext2fs/irel_ma.c')
-rw-r--r--e2fsprogs/ext2fs/irel_ma.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/e2fsprogs/ext2fs/irel_ma.c b/e2fsprogs/ext2fs/irel_ma.c
index d9e73f73c..f4fe1e0f3 100644
--- a/e2fsprogs/ext2fs/irel_ma.c
+++ b/e2fsprogs/ext2fs/irel_ma.c
@@ -309,8 +309,7 @@ static errcode_t ima_move(ext2_irel irel, ext2_ino_t old, ext2_ino_t new)
return ENOENT;
ma->entries[(unsigned) new] = ma->entries[(unsigned) old];
- if (ma->ref_entries[(unsigned) new].refs)
- ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
+ ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
ma->ref_entries[(unsigned) new] = ma->ref_entries[(unsigned) old];
ma->entries[(unsigned) old].new = 0;
@@ -332,8 +331,7 @@ static errcode_t ima_delete(ext2_irel irel, ext2_ino_t old)
return ENOENT;
ma->entries[old].new = 0;
- if (ma->ref_entries[(unsigned) old].refs)
- ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
+ ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
ma->orig_map[ma->entries[(unsigned) old].orig] = 0;
ma->ref_entries[(unsigned) old].num = 0;
@@ -352,21 +350,17 @@ static errcode_t ima_free(ext2_irel irel)
ma = irel->priv_data;
if (ma) {
- if (ma->orig_map)
- ext2fs_free_mem(&ma->orig_map);
- if (ma->entries)
- ext2fs_free_mem(&ma->entries);
+ ext2fs_free_mem(&ma->orig_map);
+ ext2fs_free_mem(&ma->entries);
if (ma->ref_entries) {
for (ino = 0; ino <= ma->max_inode; ino++) {
- if (ma->ref_entries[(unsigned) ino].refs)
- ext2fs_free_mem(&ma->ref_entries[(unsigned) ino].refs);
+ ext2fs_free_mem(&ma->ref_entries[(unsigned) ino].refs);
}
ext2fs_free_mem(&ma->ref_entries);
}
ext2fs_free_mem(&ma);
}
- if (irel->name)
- ext2fs_free_mem(&irel->name);
+ ext2fs_free_mem(&irel->name);
ext2fs_free_mem(&irel);
return 0;
}