s4:auth: Correct condition and remove redundant check
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 7 Aug 2023 00:41:45 +0000 (12:41 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:38 +0000 (04:39 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/session.c

index de7522bc4165e00f6cf3b37f1d594dca1e931fd7..9e893ec3e920f15edf87987062934785fa7c3e5f 100644 (file)
@@ -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,