Avoid closing se->fd twice in fuse_lowlevel.c (#516)
authorFabian Vogt <fabian@ritter-vogt.de>
Fri, 15 May 2020 18:32:10 +0000 (20:32 +0200)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 18:32:10 +0000 (19:32 +0100)
If fuse_session_unmount is called before fuse_session_destroy, both
would try to close(se->fd). Avoid that by resetting it in
fuse_session_unmount.

lib/fuse_lowlevel.c

index fd1f484e64b81b979cd3dc7b1328703b8a063ab0..3dabbd5fd5f3d1ff73c463238011d81075a4cf42 100644 (file)
@@ -3040,6 +3040,7 @@ void fuse_session_unmount(struct fuse_session *se)
 {
        if (se->mountpoint != NULL) {
                fuse_kern_unmount(se->mountpoint, se->fd);
+               se->fd = -1;
                free(se->mountpoint);
                se->mountpoint = NULL;
        }