summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libads/ads_struct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c
index 84c12bf665..4227684375 100644
--- a/source3/libads/ads_struct.c
+++ b/source3/libads/ads_struct.c
@@ -103,6 +103,8 @@ static char *find_ldap_server(ADS_STRUCT *ads)
{
char *list = NULL;
+ if (!ads->realm) return NULL;
+
if (ldap_domain2hostlist(ads->realm, &list) == LDAP_SUCCESS) {
char *p;
p = strchr(list, ':');
@@ -149,6 +151,7 @@ ADS_STRUCT *ads_init(const char *realm,
if (!ads->realm[0]) {
ads->realm = get_default_realm(ads);
}
+ if (!ads->realm) ads->realm = strdup("");
}
if (!ads->bind_path) {
ads->bind_path = ads_build_dn(ads->realm);