Fix more asprintf warnings and some error path errors.
[jra/samba/.git] / source3 / rpc_server / srv_lsa_hnd.c
index 78b891e071e55d6ee9433172e10d64c132963e79..839833ce542fd839c4ffb8d7180b8c30cc8f845c 100644 (file)
@@ -54,10 +54,13 @@ bool init_pipe_handle_list(pipes_struct *p, const char *pipe_name)
                                (is_samr_lsa_pipe(plist->name) && is_samr_lsa_pipe(pipe_name))) {
                        if (!plist->pipe_handles) {
                                char *msg;
-                               asprintf(&msg, "init_pipe_handles: NULL "
-                                        "pipe_handle pointer in pipe %s",
-                                        pipe_name);
-                               smb_panic(msg);
+                               if (asprintf(&msg, "init_pipe_handles: NULL "
+                                                "pipe_handle pointer in pipe %s",
+                                                pipe_name) != -1) {
+                                       smb_panic(msg);
+                               } else {
+                                       smb_panic("init_pipe_handle_list");
+                               }
                        }
                        hl = plist->pipe_handles;
                        break;
@@ -256,19 +259,13 @@ bool pipe_access_check(pipes_struct *p)
           anonymous > 0 */
 
        if (lp_restrict_anonymous() > 0) {
-               user_struct *user = get_valid_user_struct(p->vuid);
 
                /* schannel, so we must be ok */
                if (p->pipe_bound && (p->auth.auth_type == PIPE_AUTH_TYPE_SCHANNEL)) {
                        return True;
                }
 
-               if (!user) {
-                       DEBUG(3, ("invalid vuid %d\n", p->vuid));
-                       return False;
-               }
-
-               if (user->server_info->guest) {
+               if (p->server_info->guest) {
                        return False;
                }
        }