struct stat statbuf;
/* copies for freeing on exit */
- const char *opts1, *spec1, *node1, *types1, *extra_opts1;
+ const char *opts1, *spec1, *node1, *types1;
if (verbose > 2) {
printf("mount: spec: \"%s\"\n", spec0);
opts = opts1 = xstrdup(opts0);
parse_opts (opts, &flags, &extra_opts);
- extra_opts1 = extra_opts;
- mount_opts = extra_opts;
+ mount_opts = xstrdup(extra_opts);
/* quietly succeed for fstab entries that don't get mounted automatically */
if (mount_all && (flags & MS_NOAUTO))
/*
* Linux kernel does not accept any selinux context option on remount
*/
- if (mount_opts)
+ if (mount_opts) {
+ char *tmp = mount_opts;
mount_opts = remove_context_options(mount_opts);
+ my_free(tmp);
+ }
} else if (types && strcmp(types, "tmpfs") == 0 && is_selinux_enabled() > 0 &&
!has_context_option(mount_opts)) {
}
#endif
- if (extra_opts1 != mount_opts)
- my_free(mount_opts);
- my_free(extra_opts1);
+ my_free(mount_opts);
+ my_free(extra_opts);
my_free(spec1);
my_free(node1);
my_free(opts1);