]> err.no Git - util-linux/commitdiff
fsck: remove useless if-before-free tests
authorKarel Zak <kzak@redhat.com>
Tue, 24 Feb 2009 15:40:52 +0000 (16:40 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Feb 2009 15:40:52 +0000 (16:40 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fsck/fsck.c

index 2a8228d1c9b45dfb48983098f21eacd8a5f66323..e11bbe9bdb1e475634d426ff8a20f6ea09c72a5a 100644 (file)
@@ -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;