aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlegezywzh <94814730+legezywzh@users.noreply.github.com>2024-04-20 19:40:16 +0800
committerGitHub <noreply@github.com>2024-04-20 13:40:16 +0200
commit285da329ea946255d727f7340944d8a555eba850 (patch)
tree350c496d61f790c77b04c36173de506f4b47a533
parent73cd124d0408649ad20abbdee43fcc723ac2acf2 (diff)
downloadlibfuse-285da329ea946255d727f7340944d8a555eba850.tar.gz
passthrough_ll: fix fd leaks in lo_destroy() (#929)
By virtio-fs and libfuse fuse_custom_io, passthrough_ll could be a virtio filesystem device backend, this bug was found when doing mount, fsstress and umount repeatedly. Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com> Co-authored-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
-rw-r--r--example/passthrough_ll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index 4a597f2..9d38a7f 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -190,6 +190,7 @@ static void lo_destroy(void *userdata)
while (lo->root.next != &lo->root) {
struct lo_inode* next = lo->root.next;
lo->root.next = next->next;
+ close(next->fd);
free(next);
}
}