From 7009077bd2d7a8149848caf64665716ba80dccfb Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 Feb 2009 16:40:52 +0100 Subject: [PATCH] fsck: remove useless if-before-free tests Signed-off-by: Karel Zak --- fsck/fsck.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 2a8228d1..e11bbe9b 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -217,12 +217,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); return; } @@ -294,8 +291,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; -- 2.39.5