auth/credentials: add a missing talloc check to cli_credentials_set_nt_hash()
[mat/samba.git] / auth / credentials / credentials_ntlm.c
index 5e9aeeda9544d0df263002ae9dadd07873e50426..f339c9b6dc2646147322862136b603dec5f0e009 100644 (file)
@@ -276,6 +276,9 @@ _PUBLIC_ bool cli_credentials_set_nt_hash(struct cli_credentials *cred,
                cli_credentials_set_password(cred, NULL, obtained);
                if (nt_hash) {
                        cred->nt_hash = talloc(cred, struct samr_Password);
+                       if (cred->nt_hash == NULL) {
+                               return false;
+                       }
                        *cred->nt_hash = *nt_hash;
                } else {
                        cred->nt_hash = NULL;