From: Volker Lendecke Date: Tue, 3 Dec 2019 09:39:12 +0000 (+0100) Subject: smbd: Avoid a reference to share_mode_data->num_share_modes X-Git-Tag: ldb-2.1.0~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a2fa45741db6d157705f81a8830907e34f07120;p=thirdparty%2Fsamba.git smbd: Avoid a reference to share_mode_data->num_share_modes Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 8ffb0135f68..58c7c8d3038 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -2178,6 +2178,12 @@ static void mark_share_mode_disconnected_fn( void *private_data) { struct mark_share_mode_disconnected_state *state = private_data; + + if (num_share_modes != 1) { + state->ok = false; + return; + } + server_id_set_disconnected(&e->pid); e->share_file_id = state->open_persistent_id; *modified = true; @@ -2190,10 +2196,6 @@ bool mark_share_mode_disconnected(struct share_mode_lock *lck, struct mark_share_mode_disconnected_state state; bool ok; - if (lck->data->num_share_modes != 1) { - return false; - } - if (fsp->op == NULL) { return false; }