mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
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:
committed by
Bernd Schubert
parent
79aefd4fd9
commit
6c055dddf7
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user