char dev_name[128] = "DEVNAME=";
const char *dev_info_argv[] = { dev_name };
struct cuse_info ci;
+ int ret = 1;
if (fuse_opt_parse(&args, ¶m, cusexmp_opts, cusexmp_process_arg)) {
printf("failed to parse option\n");
- return 1;
+ free(param.dev_name);
+ goto out;
}
if (!param.is_help) {
if (!param.dev_name) {
fprintf(stderr, "Error: device name missing\n");
- return 1;
+ goto out;
}
- strncat(dev_name, param.dev_name, sizeof(dev_name) - 9);
+ strncat(dev_name, param.dev_name, sizeof(dev_name) - sizeof("DEVNAME="));
+ free(param.dev_name);
}
memset(&ci, 0, sizeof(ci));
ci.dev_info_argv = dev_info_argv;
ci.flags = CUSE_UNRESTRICTED_IOCTL;
- return cuse_lowlevel_main(args.argc, args.argv, &ci, &cusexmp_clop,
- NULL);
+ ret = cuse_lowlevel_main(args.argc, args.argv, &ci, &cusexmp_clop, NULL);
+
+out:
+ fuse_opt_free_args(&args);
+ return ret;
}
set -e
-# Disable leak checking for now, there are some issues (or false positives)
-# that we still need to fix
-export ASAN_OPTIONS="detect_leaks=0"
+export ASAN_OPTIONS="detect_leaks=1"
export LSAN_OPTIONS="suppressions=$(pwd)/test/lsan_suppress.txt"
export CC