auth/credentials: add a missing talloc check to cli_credentials_set_nt_hash()
authorStefan Metzmacher <metze@samba.org>
Mon, 9 Feb 2015 08:06:32 +0000 (09:06 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 12 Mar 2015 16:13:42 +0000 (17:13 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
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;