From: Joseph Sutton Date: Mon, 7 Aug 2023 00:41:45 +0000 (+1200) Subject: s4:auth: Correct condition and remove redundant check X-Git-Tag: tevent-0.16.0~1119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e663c1d96b3fa90a70bbae1ae2507232c11c94a0;p=thirdparty%2Fsamba.git s4:auth: Correct condition and remove redundant check Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/auth/session.c b/source4/auth/session.c index de7522bc416..9e893ec3e92 100644 --- a/source4/auth/session.c +++ b/source4/auth/session.c @@ -240,11 +240,9 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx, /* unless set otherwise, the session key is the user session * key from the auth subsystem */ session_info->session_key = data_blob_talloc(session_info, user_info_dc->user_session_key.data, user_info_dc->user_session_key.length); - if (!session_info->session_key.data && session_info->session_key.length) { - if (session_info->session_key.data == NULL) { - TALLOC_FREE(tmp_ctx); - return NT_STATUS_NO_MEMORY; - } + if (!session_info->session_key.data && user_info_dc->user_session_key.length) { + TALLOC_FREE(tmp_ctx); + return NT_STATUS_NO_MEMORY; } nt_status = auth_generate_security_token(session_info,