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/libsmb | |
parent | 6b915bfd0f4194453c1b01158f2c2772b2a2df2f (diff) | |
download | samba-32037e0533f720ebbd3f49c5951c4ef30aac9985.tar.gz samba-32037e0533f720ebbd3f49c5951c4ef30aac9985.tar.bz2 samba-32037e0533f720ebbd3f49c5951c4ef30aac9985.zip |
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/libsmb')
-rw-r--r-- | source3/libsmb/dsgetdcname.c | 4 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 12 | ||||
-rw-r--r-- | source3/libsmb/namequery_dc.c | 14 |
3 files changed, 15 insertions, 15 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 4f2aa632fe..71995fd2ee 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -1185,7 +1185,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, bool retry_query_with_null = false; if ((site_name == NULL) || (site_name[0] == '\0')) { - ptr_to_free = sitename_fetch(domain_name); + ptr_to_free = sitename_fetch(mem_ctx, domain_name); if (ptr_to_free != NULL) { retry_query_with_null = true; } @@ -1202,7 +1202,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, flags, info); - SAFE_FREE(ptr_to_free); + TALLOC_FREE(ptr_to_free); if (!NT_STATUS_EQUAL(status, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND)) { return status; diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 7fac0c97f8..f2fffde8b4 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2799,7 +2799,7 @@ bool resolve_name(const char *name, return interpret_string_addr(return_ss, name, AI_NUMERICHOST); } - sitename = sitename_fetch(lp_realm()); /* wild guess */ + sitename = sitename_fetch(talloc_tos(), lp_realm()); /* wild guess */ status = internal_resolve_name(name, name_type, sitename, &ss_list, &count, @@ -2814,7 +2814,7 @@ bool resolve_name(const char *name, (ss_list[i].ss.ss_family == AF_INET)) { *return_ss = ss_list[i].ss; SAFE_FREE(ss_list); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return True; } } @@ -2826,14 +2826,14 @@ bool resolve_name(const char *name, !is_broadcast_addr((struct sockaddr *)(void *)&ss_list[i].ss)) { *return_ss = ss_list[i].ss; SAFE_FREE(ss_list); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return True; } } } SAFE_FREE(ss_list); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return False; } @@ -2873,12 +2873,12 @@ NTSTATUS resolve_name_list(TALLOC_CTX *ctx, return NT_STATUS_OK; } - sitename = sitename_fetch(lp_realm()); /* wild guess */ + sitename = sitename_fetch(ctx, lp_realm()); /* wild guess */ status = internal_resolve_name(name, name_type, sitename, &ss_list, &count, lp_name_resolve_order()); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); if (!NT_STATUS_IS_OK(status)) { return status; diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c index df5eeb8d89..3cfae79257 100644 --- a/source3/libsmb/namequery_dc.c +++ b/source3/libsmb/namequery_dc.c @@ -64,13 +64,13 @@ static bool ads_dc_name(const char *domain, realm = lp_realm(); } - sitename = sitename_fetch(realm); + sitename = sitename_fetch(talloc_tos(), realm); /* Try this 3 times then give up. */ for( i =0 ; i < 3; i++) { ads = ads_init(realm, domain, NULL); if (!ads) { - SAFE_FREE(sitename); + TALLOC_FREE(sitename); return False; } @@ -83,7 +83,7 @@ static bool ads_dc_name(const char *domain, #endif if (!ads->config.realm) { - SAFE_FREE(sitename); + TALLOC_FREE(sitename); ads_destroy(&ads); return False; } @@ -93,8 +93,8 @@ static bool ads_dc_name(const char *domain, to ensure we only find servers in our site. */ if (stored_sitename_changed(realm, sitename)) { - SAFE_FREE(sitename); - sitename = sitename_fetch(realm); + TALLOC_FREE(sitename); + sitename = sitename_fetch(talloc_tos(), realm); ads_destroy(&ads); /* Ensure we don't cache the DC we just connected to. */ namecache_delete(realm, 0x1C); @@ -129,12 +129,12 @@ static bool ads_dc_name(const char *domain, if (i == 3) { DEBUG(1,("ads_dc_name: sitename (now \"%s\") keeps changing ???\n", sitename ? sitename : "")); - SAFE_FREE(sitename); + TALLOC_FREE(sitename); ads_destroy(&ads); return False; } - SAFE_FREE(sitename); + TALLOC_FREE(sitename); fstrcpy(srv_name, ads->config.ldap_server_name); if (!strupper_m(srv_name)) { |