Currently, mounting on FreeBSD fails like this:
mount_fusefs: ZZZZ<snip> on /mountpoint: No such file or directory
This happens because right after doing argv[a++] = fdnam it's
getting freed before calling execvp().
So move this free() call after execvp(). Also, when asprintf()
fails for fdnam, close device fd before calling exit().
if(ret == -1)
{
perror("fuse: failed to assemble mount arguments");
+ close(fd);
exit(1);
}
}
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);
}