summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-04-19 03:00:29 +0000
committerAndrew Tridgell <tridge@samba.org>2002-04-19 03:00:29 +0000
commitfc78c773f8216df1bbaa88d9007cf3f5df386e3d (patch)
tree961fa8a62c1fb4a15bfa617aa0bd58f143c47d0f /source3/libads/ldap.c
parente762f93821a21f460fecf7452d2363574ab04dad (diff)
downloadsamba-fc78c773f8216df1bbaa88d9007cf3f5df386e3d.tar.gz
samba-fc78c773f8216df1bbaa88d9007cf3f5df386e3d.tar.bz2
samba-fc78c773f8216df1bbaa88d9007cf3f5df386e3d.zip
fixed trust relationships in ADS winbindd after breaking them with my BDC changes ...
(This used to be commit 8096032663690eafb6bb8b4f405d6231389d4f80)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 3b787c6a8f..543e53bcf8 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -45,7 +45,11 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
ads->last_attempt = time(NULL);
- ads->ld = ldap_open(ads->ldap_server, ads->ldap_port);
+ ads->ld = NULL;
+
+ if (ads->ldap_server) {
+ ads->ld = ldap_open(ads->ldap_server, ads->ldap_port);
+ }
/* if that failed then try each of the BDC's in turn */
if (!ads->ld) {
@@ -60,7 +64,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
if (ads->ld) break;
}
if (ads->ld) {
- free(ads->ldap_server);
+ SAFE_FREE(ads->ldap_server);
ads->ldap_server = strdup(inet_ntoa(ip_list[i]));
}
free(ip_list);