summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_ads.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-09-04 13:39:31 -0700
committerJeremy Allison <jra@samba.org>2013-09-05 09:17:13 -0700
commit6b915bfd0f4194453c1b01158f2c2772b2a2df2f (patch)
treec1fcb0b1b0ff7abba4d2e27b7b853ce9b6926ed3 /source3/winbindd/winbindd_ads.c
parent8a7246ac2c5b27cc29e6ca23c1e2e0f43e298eb5 (diff)
downloadsamba-6b915bfd0f4194453c1b01158f2c2772b2a2df2f.tar.gz
samba-6b915bfd0f4194453c1b01158f2c2772b2a2df2f.tar.bz2
samba-6b915bfd0f4194453c1b01158f2c2772b2a2df2f.zip
Add a talloc context to saf_fetch().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd_ads.c')
-rw-r--r--source3/winbindd/winbindd_ads.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 4c2638900f..18749c97c4 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -151,7 +151,7 @@ ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name)
* Check if we can get server nam and realm from SAF cache
* and the domain list.
*/
- ldap_server = saf_fetch(dom_name);
+ ldap_server = saf_fetch(talloc_tos(), dom_name);
DEBUG(10, ("ldap_server from saf cache: '%s'\n",
ldap_server ? ldap_server : ""));
@@ -165,6 +165,7 @@ ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name)
" domain '%s'\n", wb_dom->alt_name, dom_name));
if (!get_trust_pw_clear(dom_name, &password, NULL, NULL)) {
+ TALLOC_FREE(ldap_server);
return ADS_ERROR_NT(NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
}
@@ -190,6 +191,7 @@ ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name)
status = ads_cached_connection_connect(adsp, realm, dom_name, ldap_server,
password, realm, 0);
SAFE_FREE(realm);
+ TALLOC_FREE(ldap_server);
return status;
}