summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/context_mount.c')
-rw-r--r--libmount/src/context_mount.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 264276899..6661394ff 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -67,16 +67,27 @@ static int fix_optstr(struct libmnt_context *cxt)
/*
* Sync mount options with mount flags
*/
+ DBG(CXT, mnt_debug_h(cxt, "mount: fixing vfs optstr"));
rc = mnt_optstr_apply_flags(&fs->vfs_optstr, cxt->mountflags,
mnt_get_builtin_optmap(MNT_LINUX_MAP));
if (rc)
goto done;
+ DBG(CXT, mnt_debug_h(cxt, "mount: fixing user optstr"));
rc = mnt_optstr_apply_flags(&fs->user_optstr, cxt->user_mountflags,
mnt_get_builtin_optmap(MNT_USERSPACE_MAP));
if (rc)
goto done;
+ if (fs->vfs_optstr && *fs->vfs_optstr == '\0') {
+ free(fs->vfs_optstr);
+ fs->vfs_optstr = NULL;
+ }
+ if (fs->user_optstr && *fs->user_optstr == '\0') {
+ free(fs->user_optstr);
+ fs->user_optstr = NULL;
+ }
+
next = fs->fs_optstr;
#ifdef HAVE_LIBSELINUX