rpc_server: Simplify make_server_pipes_struct
authorVolker Lendecke <vl@samba.org>
Wed, 20 Mar 2019 12:45:32 +0000 (13:45 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 22 Mar 2019 18:02:16 +0000 (18:02 +0000)
Do an early return on error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/rpc_server.c

index 36dff114f90775a66430041d51cb8cdcb0f7cef3..0086fea48a42cb05fceadc6c124aa225ed42b379 100644 (file)
@@ -57,16 +57,17 @@ int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
                return -1;
        }
 
-       if (session_info->unix_token && session_info->unix_info && session_info->security_token) {
-               /* Don't call create_local_token(), we already have the full details here */
-               p->session_info = talloc_steal(p, session_info);
-
-       } else {
-               DEBUG(0, ("Supplied session_info in make_server_pipes_struct was incomplete!"));
+       if ((session_info->unix_token == NULL) ||
+           (session_info->unix_info == NULL) ||
+           (session_info->security_token == NULL)) {
+               DBG_ERR("Supplied session_info was incomplete!\n");
                *perrno = EINVAL;
                return -1;
        }
 
+       /* Don't call create_local_token(), we already have the full details here */
+       p->session_info = talloc_steal(p, session_info);
+
        *_p = p;
        return 0;
 }