]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix bugs detected by [smatch scan]
authorKarel Zak <kzak@redhat.com>
Tue, 17 Jan 2012 16:16:57 +0000 (17:16 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Jan 2012 16:16:57 +0000 (17:16 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/utils.c

index 9d5933c5644544c2a0184a8cdc0ae18f79b9c1a3..17bbd428711e71d77a858d6df99e6433bcc7556f 100644 (file)
@@ -243,7 +243,7 @@ static int evaluate_permissions(struct libmnt_context *cxt)
 
                                cxt->user_mountflags |= MNT_MS_USER;
 
-                       if (!cache && xsrc)
+                       if (!cache)
                                free(xsrc);
                }
 
index cbaabc6c4c948d9642ae92f3446290cf895682e9..c4f5f9910fcc490e0631c25d8b1f3e3bb5f4c3b0 100644 (file)
@@ -59,7 +59,7 @@ int mnt_parse_offset(const char *str, size_t len, uintmax_t *res)
        char *p;
        int rc = 0;
 
-       if (!str && !*str)
+       if (!str || !*str)
                return -EINVAL;
 
        p = strndup(str, len);