From: legezywzh <94814730+legezywzh@users.noreply.github.com> Date: Sat, 20 Apr 2024 11:40:16 +0000 (+0800) Subject: passthrough_ll: fix fd leaks in lo_destroy() (#929) X-Git-Tag: fuse-3.17.1-rc0~130 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=285da329ea946255d727f7340944d8a555eba850;p=qemu-gpiodev%2Flibfuse.git 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 Co-authored-by: Xiaoguang Wang --- 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); } }