summaryrefslogtreecommitdiff
path: root/shlibs/mount/src/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'shlibs/mount/src/fs.c')
-rw-r--r--shlibs/mount/src/fs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c
index 91d8d2242..d5bd16717 100644
--- a/shlibs/mount/src/fs.c
+++ b/shlibs/mount/src/fs.c
@@ -297,10 +297,11 @@ int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source)
assert(fs);
- if (source && !strcmp(source, "none"))
+ if (source && !strcmp(source, "none")) {
+ free(source);
source = NULL;
-
- if (source && strchr(source, '=')) {
+ }
+ else if (source && strchr(source, '=')) {
if (blkid_parse_tag_string(source, &t, &v) != 0)
return -1;
}