From: Stefan Metzmacher Date: Fri, 26 Aug 2022 10:08:03 +0000 (+0200) Subject: s3:locking: make use of share_mode_lock_file_id() in share_mode_watch_send() X-Git-Tag: talloc-2.4.0~881 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eef0c8e25bcedb6b0028866c7540c6feeabb0dd0;p=thirdparty%2Fsamba.git s3:locking: make use of share_mode_lock_file_id() in share_mode_watch_send() We should avoid dereference 'struct share_mode_lock' as much as possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index c7d3ae3bd82..549a360e93f 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -1308,7 +1308,8 @@ struct tevent_req *share_mode_watch_send( struct share_mode_lock *lck, struct server_id blocker) { - TDB_DATA key = locking_key(&lck->data->id); + struct file_id id = share_mode_lock_file_id(lck); + TDB_DATA key = locking_key(&id); struct tevent_req *req = NULL, *subreq = NULL; struct share_mode_watch_state *state = NULL;