aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Rostislav Skudnov <rostislav@tuxera.com>2018-07-21 21:14:13 +0000
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2018-07-23 11:02:57 +0100
commitc7ae066cb455ba7beafe8a8b9091a05a36c9bd55 (patch)
tree538996f9ce6edb7513fc827f842ee511b6210ef4
parentefa3032bc9a6d9028084a8c33c9b31946b16aea1 (diff)
test_write_cache: Fix memory leaks
-rw-r--r--test/test_write_cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_write_cache.c b/test/test_write_cache.c
index ac813a9..7a6d7e6 100644
--- a/test/test_write_cache.c
+++ b/test/test_write_cache.c
@@ -175,6 +175,7 @@ static void test_fs(char *mountpoint) {
assert(write(fd, buf, dsize) == dsize);
assert(write(fd, buf, dsize) == dsize);
+ free(buf);
close(fd);
}
@@ -191,6 +192,7 @@ int main(int argc, char *argv[]) {
#endif
se = fuse_session_new(&args, &tfs_oper,
sizeof(tfs_oper), NULL);
+ fuse_opt_free_args(&args);
assert (se != NULL);
assert(fuse_set_signal_handlers(se) == 0);
assert(fuse_session_mount(se, fuse_opts.mountpoint) == 0);
@@ -200,6 +202,7 @@ int main(int argc, char *argv[]) {
/* Write test data */
test_fs(fuse_opts.mountpoint);
+ free(fuse_opts.mountpoint);
/* Stop file system */
assert(pthread_cancel(fs_thread) == 0);