From a2a09e7cca6ddda42c5523654df057fa1578500e Mon Sep 17 00:00:00 2001 From: Rostislav Skudnov Date: Sat, 21 Jul 2018 21:14:19 +0000 Subject: example/{hello,null}: Fix memory leaks --- example/null.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'example/null.c') diff --git a/example/null.c b/example/null.c index c90e86d..ed68c0b 100644 --- a/example/null.c +++ b/example/null.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,7 @@ int main(int argc, char *argv[]) if (fuse_parse_cmdline(&args, &opts) != 0) return 1; + fuse_opt_free_args(&args); if (!opts.mountpoint) { fprintf(stderr, "missing mountpoint parameter\n"); @@ -128,8 +130,10 @@ int main(int argc, char *argv[]) if (stat(opts.mountpoint, &stbuf) == -1) { fprintf(stderr ,"failed to access mountpoint %s: %s\n", opts.mountpoint, strerror(errno)); + free(opts.mountpoint); return 1; } + free(opts.mountpoint); if (!S_ISREG(stbuf.st_mode)) { fprintf(stderr, "mountpoint is not a regular file\n"); return 1; -- cgit v1.2.3