support: Fix memory leaks in FUSE tests

The internal read buffer (used by all FUSE tests) was not freed.
The support/tst-support_fuse test missed a deallocation.
This commit is contained in:
Florian Weimer 2024-09-21 19:25:35 +02:00
parent e3db0a699c
commit 455c762283
2 changed files with 2 additions and 0 deletions

View File

@ -659,6 +659,7 @@ support_fuse_unmount (struct support_fuse *f)
if (rmdir (f->mountpoint) != 0) if (rmdir (f->mountpoint) != 0)
FAIL ("FUSE: rmdir (\"%s\"): %m", f->mountpoint); FAIL ("FUSE: rmdir (\"%s\"): %m", f->mountpoint);
xclose (f->fd); xclose (f->fd);
free (f->buffer_start);
free (f->mountpoint); free (f->mountpoint);
free (f->readdir_buffer); free (f->readdir_buffer);
free (f); free (f);

View File

@ -331,6 +331,7 @@ do_test (void)
{ {
char *subdir_path = xasprintf ("%s/subdir", support_fuse_mountpoint (f)); char *subdir_path = xasprintf ("%s/subdir", support_fuse_mountpoint (f));
xmkdir (subdir_path, 01234); xmkdir (subdir_path, 01234);
free (subdir_path);
} }
{ {