s3: Slightly simplify winbindd_dual_ccache_ntlm_auth
authorVolker Lendecke <vl@samba.org>
Sat, 19 Dec 2009 23:27:34 +0000 (00:27 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 3 Jan 2010 10:38:22 +0000 (11:38 +0100)
data_blob_const can't fail

source3/winbindd/winbindd_ccache_access.c

index f8f9ddfad5c4b1c138d00ef94f3a6c1ab91670e0..921110a0be5bf6527972150728208507bb97d47e 100644 (file)
@@ -251,21 +251,15 @@ enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *doma
                goto process_result;
        }
 
                goto process_result;
        }
 
-       initial = data_blob(state->request->extra_data.data, initial_blob_len);
-       challenge = data_blob(state->request->extra_data.data + initial_blob_len,
-                               state->request->data.ccache_ntlm_auth.challenge_blob_len);
-
-       if (!initial.data || !challenge.data) {
-               result = NT_STATUS_NO_MEMORY;
-       } else {
-               result = do_ntlm_auth_with_hashes(name_user, name_domain,
-                                               entry->lm_hash, entry->nt_hash,
-                                               initial, challenge, &auth);
-       }
-
-       data_blob_free(&initial);
-       data_blob_free(&challenge);
-
+       initial = data_blob_const(state->request->extra_data.data,
+                                 initial_blob_len);
+       challenge = data_blob_const(
+               state->request->extra_data.data + initial_blob_len,
+               state->request->data.ccache_ntlm_auth.challenge_blob_len);
+
+       result = do_ntlm_auth_with_hashes(name_user, name_domain,
+                                         entry->lm_hash, entry->nt_hash,
+                                         initial, challenge, &auth);
        if (!NT_STATUS_IS_OK(result)) {
                goto process_result;
        }
        if (!NT_STATUS_IS_OK(result)) {
                goto process_result;
        }