diff options
author | Maninder Singh <maninder1.s@samsung.com> | 2015-06-01 10:38:07 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-06-07 18:19:43 +0200 |
commit | 0fabedf085591b50994e4f8c133bfa87f1777ee4 (patch) | |
tree | 8308679426e463e68eb9f61cf5883c03c437c79d /e2fsprogs/old_e2fsprogs/fsck.c | |
parent | d90899206dd96b4c18064c18afc3b856382e64d4 (diff) |
fix if(p)/free(p) construct
No need of explicit NULL check before free.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'e2fsprogs/old_e2fsprogs/fsck.c')
-rw-r--r-- | e2fsprogs/old_e2fsprogs/fsck.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/e2fsprogs/old_e2fsprogs/fsck.c b/e2fsprogs/old_e2fsprogs/fsck.c index 91cce970c..87874ce71 100644 --- a/e2fsprogs/old_e2fsprogs/fsck.c +++ b/e2fsprogs/old_e2fsprogs/fsck.c @@ -354,12 +354,9 @@ static void parse_escape(char *word) static void free_instance(struct fsck_instance *i) { - if (i->prog) - free(i->prog); - if (i->device) - free(i->device); - if (i->base_device) - free(i->base_device); + free(i->prog); + free(i->device); + free(i->base_device); free(i); } @@ -432,8 +429,7 @@ static int parse_fstab_line(char *line, struct fs_info **ret_fs) fs = create_fs_device(device, mntpnt, type ? type : "auto", opts, freq ? atoi(freq) : -1, passno ? atoi(passno) : -1); - if (dev) - free(dev); + free(dev); if (!fs) return -1; |