diff options
author | Rob Landley | 2006-03-01 16:39:45 +0000 |
---|---|---|
committer | Rob Landley | 2006-03-01 16:39:45 +0000 |
commit | e7c43b66d74ee9902a6732122788a7a16bcfbf18 (patch) | |
tree | ebb8583e9e1265588592614c0b4878daded44125 /e2fsprogs/blkid/tag.c | |
parent | 93f2286e6e59dab5eed14b5912a79254031c5a62 (diff) | |
download | busybox-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/blkid/tag.c')
-rw-r--r-- | e2fsprogs/blkid/tag.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/e2fsprogs/blkid/tag.c b/e2fsprogs/blkid/tag.c index e2c785c..95112eb 100644 --- a/e2fsprogs/blkid/tag.c +++ b/e2fsprogs/blkid/tag.c @@ -41,11 +41,8 @@ void blkid_free_tag(blkid_tag tag) list_del(&tag->bit_tags); /* list of tags for this device */ list_del(&tag->bit_names); /* list of tags with this type */ - if (tag->bit_name) - free(tag->bit_name); - if (tag->bit_val) - free(tag->bit_val); - + free(tag->bit_name); + free(tag->bit_val); free(tag); } @@ -112,8 +109,7 @@ int blkid_set_tag(blkid_dev dev, const char *name, return -BLKID_ERR_MEM; t = blkid_find_tag_dev(dev, name); if (!value) { - if (t) - blkid_free_tag(t); + blkid_free_tag(t); } else if (t) { if (!strcmp(t->bit_val, val)) { /* Same thing, exit */ @@ -165,12 +161,10 @@ int blkid_set_tag(blkid_dev dev, const char *name, return 0; errout: - if (t) - blkid_free_tag(t); - else if (val) + blkid_free_tag(t); + if (!t) free(val); - if (head) - blkid_free_tag(head); + blkid_free_tag(head); return -BLKID_ERR_MEM; } |