From 0208ae2e0c9f212914f4400078918a6c5df2e2d4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 17 Jan 2012 17:16:57 +0100 Subject: libmount: fix bugs detected by [smatch scan] Signed-off-by: Karel Zak --- libmount/src/context_mount.c | 2 +- libmount/src/utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libmount') diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 9d5933c56..17bbd4287 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -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); } diff --git a/libmount/src/utils.c b/libmount/src/utils.c index cbaabc6c4..c4f5f9910 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -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); -- cgit v1.2.3-55-g7522