mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
6b567e0c13
Allocate state off fsp->conn, not NULL, and add a destructor that catches deallocation of conn which happens on connection shutdown or force close. Note - We don't allocate off fsp as the passed in fsp will get freed once we return EINPROGRESS/NT_STATUS_MORE_PROCESSING_REQUIRED. A new fsp pointer gets allocated on every re-run of the open code path. The destructor allows us to NULL out the saved conn struct pointer when conn is deallocated so we know not to access deallocated memory. This matches the async teardown code changes for bug #14301 in pread/pwrite/fsync vfs_default.c and vfs_glusterfs.c state is still correctly deallocated in all code paths so no memory leaks. This allows us to safely complete when the openat() returns and then return the error NT_STATUS_NETWORK_NAME_DELETED to the client open request. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>