diff --git a/lib/mount_bsd.c b/lib/mount_bsd.c index 94a11f73a..cbd3ced87 100644 --- a/lib/mount_bsd.c +++ b/lib/mount_bsd.c @@ -222,6 +222,7 @@ static int fuse_mount_core(const char *mountpoint, const char *opts) if(ret == -1) { perror("fuse: failed to assemble mount arguments"); + close(fd); exit(1); } } @@ -232,14 +233,11 @@ static int fuse_mount_core(const char *mountpoint, const char *opts) argv[a++] = opts; } argv[a++] = fdnam; - - if(ret != -1) - free(fdnam); - argv[a++] = mountpoint; argv[a++] = NULL; execvp(mountprog, (char **) argv); perror("fuse: failed to exec mount program"); + free(fdnam); exit(1); }