From 6dab7c9dbec1d8eb29990a616f1e446dc4d016eb Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 13 Aug 2009 09:50:19 +0200 Subject: 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. --- source4/dsdb/samdb/cracknames.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4') 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; -- cgit