Signed-off-by: Kefu Chai <kchai@redhat.com>
static void fuse_usage()
{
- const char **argv = (const char **) malloc((2) * sizeof(char *));
- argv[0] = "ceph-fuse";
- argv[1] = "-h";
+ const char* argv[] = {
+ "ceph-fuse",
+ "-h",
+ };
struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv);
if (fuse_parse_cmdline(&args, NULL, NULL, NULL) == -1) {
derr << "fuse_parse_cmdline failed." << dendl;
- fuse_opt_free_args(&args);
}
-
- assert(args.allocated); // Checking fuse has realloc'd args so we can free newargv
- free(argv);
+ assert(args.allocated);
+ fuse_opt_free_args(&args);
}
+
void usage()
{
cout <<