summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-13 09:50:19 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-14 00:14:14 +0200
commit6dab7c9dbec1d8eb29990a616f1e446dc4d016eb (patch)
tree3455786855fae4b07ef13a9f43b7ea22f7681efc /source4/dsdb/samdb
parent093148c1f0eca1ee40552c8eddfdc1ba2554d64e (diff)
downloadsamba-6dab7c9dbec1d8eb29990a616f1e446dc4d016eb.tar.gz
samba-6dab7c9dbec1d8eb29990a616f1e446dc4d016eb.tar.bz2
samba-6dab7c9dbec1d8eb29990a616f1e446dc4d016eb.zip
s4: cracknames.c: Change the handling of the NT_STATUS_NO_MEMORY status results
With the previous check I got random failures when trying to connect to the LDAP server.
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/cracknames.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 8e97c45e7e..723f51356a 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -1278,6 +1278,9 @@ NTSTATUS crack_name_to_nt4_name(TALLOC_CTX *mem_ctx,
}
*nt4_domain = talloc_strdup(mem_ctx, info1.result_name);
+ if (*nt4_domain == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
p = strchr(*nt4_domain, '\\');
if (!p) {
@@ -1287,10 +1290,9 @@ NTSTATUS crack_name_to_nt4_name(TALLOC_CTX *mem_ctx,
if (p[1]) {
*nt4_account = talloc_strdup(mem_ctx, &p[1]);
- }
-
- if (!*nt4_account || !*nt4_domain) {
- return NT_STATUS_NO_MEMORY;
+ if (*nt4_account == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
}
return NT_STATUS_OK;