]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Fix memory leaks in FUSE tests
authorFlorian Weimer <fweimer@redhat.com>
Sat, 21 Sep 2024 17:25:35 +0000 (19:25 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Sat, 21 Sep 2024 17:25:35 +0000 (19:25 +0200)
The internal read buffer (used by all FUSE tests) was not freed.
The support/tst-support_fuse test missed a deallocation.

support/support_fuse.c
support/tst-support_fuse.c

index 135dbf1198d5a4c7ad70a2ea83610af473c37e04..f6c063b549e2c26c6dc5cb609511ae4e2bb167be 100644 (file)
@@ -659,6 +659,7 @@ support_fuse_unmount (struct support_fuse *f)
   if (rmdir (f->mountpoint) != 0)
     FAIL ("FUSE: rmdir (\"%s\"): %m", f->mountpoint);
   xclose (f->fd);
+  free (f->buffer_start);
   free (f->mountpoint);
   free (f->readdir_buffer);
   free (f);
index c4075a6608d9dd65e8fd180f8e3aa61a398a194e..9ee637cbab6f6b9ec087b3682b782c11306a609f 100644 (file)
@@ -331,6 +331,7 @@ do_test (void)
   {
     char *subdir_path = xasprintf ("%s/subdir", support_fuse_mountpoint (f));
     xmkdir (subdir_path, 01234);
+    free (subdir_path);
   }
 
   {