fuse_lowlevel: Free mountpoint in fuse_session_destroy

If fuse_session_mount() succeeds but fuse_session_unmount() is never
called (e.g., on an error path), the mountpoint string allocated by
strdup in fuse_session_mount() is leaked. Free it in
fuse_session_destroy() using the same atomic_exchange pattern as
fuse_session_unmount() to handle concurrent access safely.

Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
This commit is contained in:
Abhinav Agarwal
2026-04-15 10:32:32 -07:00
committed by Bernd Schubert
parent 79aefd4fd9
commit 6c055dddf7
+1
View File
@@ -4163,6 +4163,7 @@ void fuse_session_destroy(struct fuse_session *se)
pthread_mutex_unlock(&se->timeout_thread->lock);
}
free(atomic_exchange(&se->mountpoint, NULL));
free(se);
}