summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-08-06 03:26:58 +0000
committerAndrew Tridgell <tridge@samba.org>2002-08-06 03:26:58 +0000
commit74c8441e9d21f317b74032b5bdd17c8d2f78c015 (patch)
tree3ac5eb7e307bb9f676dd123ea4572632d3568793
parent269c713edf9554e3b0670a8ed6b606e743e807f7 (diff)
downloadsamba-74c8441e9d21f317b74032b5bdd17c8d2f78c015.tar.gz
samba-74c8441e9d21f317b74032b5bdd17c8d2f78c015.tar.bz2
samba-74c8441e9d21f317b74032b5bdd17c8d2f78c015.zip
fixed a memory corruption bug in ads_try_dns()
(This used to be commit 2ee0abb50f25e5a4529d8c9409c979a7a00e5984)
-rw-r--r--source3/libads/ldap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index a8126faffe..c8d940f331 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -89,27 +89,27 @@ static BOOL ads_try_dns(ADS_STRUCT *ads)
realm = ads->server.realm;
if (!realm || !*realm) {
- SAFE_FREE(realm);
realm = lp_realm();
}
if (!realm || !*realm) {
- SAFE_FREE(realm);
realm = ads->server.workgroup;
}
if (!realm || !*realm) {
- SAFE_FREE(realm);
realm = lp_workgroup();
}
if (!realm) {
return False;
}
+ realm = smb_xstrdup(realm);
DEBUG(6,("ads_try_dns: looking for realm '%s'\n", realm));
if (ldap_domain2hostlist(realm, &list) != LDAP_SUCCESS) {
+ SAFE_FREE(realm);
return False;
}
DEBUG(6,("ads_try_dns: ldap realm '%s' host list '%s'\n", realm, list));
+ SAFE_FREE(realm);
count = count_chars(list, ' ') + 1;
ip_list = malloc(count * sizeof(struct ldap_ip));