Skip to content

Commit

Permalink
fusefs: fix some memory leaks in the tests
Browse files Browse the repository at this point in the history
MFC after:	2 weeks
  • Loading branch information
asomers committed Jan 19, 2024
1 parent dfe30e4 commit 39f5d8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/sys/fs/fusefs/fallocate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ TEST_F(Fspacectl, erofs)
build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1);
build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1);
ASSERT_EQ(0, nmount(iov, iovlen, newflags)) << strerror(errno);
free_iovec(&iov, &iovlen);

EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
EXPECT_EQ(EROFS, errno);
Expand Down Expand Up @@ -633,6 +634,7 @@ TEST_F(PosixFallocate, erofs)
build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1);
build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1);
ASSERT_EQ(0, nmount(iov, iovlen, newflags)) << strerror(errno);
free_iovec(&iov, &iovlen);

EXPECT_EQ(EROFS, posix_fallocate(fd, offset, length));

Expand Down
1 change: 1 addition & 0 deletions tests/sys/fs/fusefs/mockfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions,
if (nmount(iov, iovlen, 0))
throw(std::system_error(errno, std::system_category(),
"Couldn't mount filesystem"));
free_iovec(&iov, &iovlen);

// Setup default handler
ON_CALL(*this, process(_, _))
Expand Down

0 comments on commit 39f5d8d

Please sign in to comment.