diff options
author | Jeremy Allison <jra@samba.org> | 2013-09-04 13:58:18 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-09-05 09:17:27 -0700 |
commit | 32037e0533f720ebbd3f49c5951c4ef30aac9985 (patch) | |
tree | f9db5cdac1da5bd09fb0e2a6e373a96a9847c08b /source3/libads/ldap.c | |
parent | 6b915bfd0f4194453c1b01158f2c2772b2a2df2f (diff) | |
download | samba-32037e0533f720ebbd3f49c5951c4ef30aac9985.tar.gz |
Add a talloc context to sitename_fetch().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r-- | source3/libads/ldap.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index c8ef5b5774d..12aacd46620 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -414,7 +414,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) return NT_STATUS_NO_LOGON_SERVERS; } - sitename = sitename_fetch(realm); + sitename = sitename_fetch(talloc_tos(), realm); again: @@ -429,7 +429,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) goto again; } - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return status; } @@ -464,7 +464,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) if ( ads_try_connect(ads, server, false) ) { SAFE_FREE(ip_list); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return NT_STATUS_OK; } @@ -481,7 +481,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) if (sitename) { DEBUG(1,("ads_find_dc: failed to find a valid DC on our site (%s), " "trying to find another DC\n", sitename)); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); namecache_delete(realm, 0x1C); goto again; } @@ -563,9 +563,9 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads) if (!realm) realm = lp_realm(); - if ((sitename = sitename_fetch(realm)) == NULL) { + if ((sitename = sitename_fetch(frame, realm)) == NULL) { ads_lookup_site(); - sitename = sitename_fetch(realm); + sitename = sitename_fetch(frame, realm); } dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL); @@ -581,8 +581,6 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads) realm, sitename, &gcs_list, &num_gcs); - SAFE_FREE(sitename); - if (!NT_STATUS_IS_OK(nt_status)) { ads_status = ADS_ERROR_NT(nt_status); goto done; @@ -618,7 +616,6 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads) } while (!done); done: - SAFE_FREE(sitename); talloc_destroy(frame); return ads_status; |