aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/mount.fuse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/util/mount.fuse.c b/util/mount.fuse.c
index 1fc98f1..f7e60c7 100644
--- a/util/mount.fuse.c
+++ b/util/mount.fuse.c
@@ -233,6 +233,7 @@ int main(int argc, char *argv[])
{
char *type = NULL;
char *source;
+ char *dup_source = NULL;
const char *mountpoint;
char *basename;
char *options = NULL;
@@ -243,6 +244,7 @@ int main(int argc, char *argv[])
int suid = 1;
int pass_fuse_fd = 0;
int drop_privileges = 0;
+ char *dev_fd_mountpoint = NULL;
progname = argv[0];
basename = strrchr(argv[0], '/');
@@ -340,6 +342,7 @@ int main(int argc, char *argv[])
}
opt = strtok(NULL, ",");
}
+ free(opts);
}
}
@@ -360,7 +363,8 @@ int main(int argc, char *argv[])
if (!type) {
if (source) {
- type = xstrdup(source);
+ dup_source = xstrdup(source);
+ type = dup_source;
source = strchr(type, '#');
if (source)
*source++ = '\0';
@@ -410,7 +414,7 @@ int main(int argc, char *argv[])
if (pass_fuse_fd) {
int fuse_fd = prepare_fuse_fd(mountpoint, type, options);
- char *dev_fd_mountpoint = xrealloc(NULL, 20);
+ dev_fd_mountpoint = xrealloc(NULL, 20);
snprintf(dev_fd_mountpoint, 20, "/dev/fd/%u", fuse_fd);
mountpoint = dev_fd_mountpoint;
}
@@ -429,6 +433,11 @@ int main(int argc, char *argv[])
add_arg(&command, options);
}
+ free(options);
+ free(dev_fd_mountpoint);
+ free(dup_source);
+ free(setuid_name);
+
execl("/bin/sh", "/bin/sh", "-c", command, NULL);
fprintf(stderr, "%s: failed to execute /bin/sh: %s\n", progname,
strerror(errno));