From: Jeremy Allison Date: Wed, 26 Aug 2020 19:00:00 +0000 (-0700) Subject: s3: winbindd: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc(). X-Git-Tag: talloc-2.3.2~617 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8b7162415d0869eb302847cf4ce31e45438999f;p=thirdparty%2Fsamba.git s3: winbindd: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 854c227ad9d..00b0bd8a336 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1536,8 +1536,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, fstring dcname; struct sockaddr_storage ss; struct ip_service *ip_list = NULL; - int iplist_size = 0; - int i; + size_t iplist_size = 0; + size_t i; bool is_our_domain; enum security_types sec = (enum security_types)lp_security(); @@ -1574,8 +1574,12 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, if (sitename) { /* Do the site-specific AD dns lookup first. */ - get_sorted_dc_list(domain->alt_name, sitename, &ip_list, - &iplist_size, True); + (void)get_sorted_dc_list_talloc(mem_ctx, + domain->alt_name, + sitename, + &ip_list, + &iplist_size, + true); /* Add ips to the DC array. We don't look up the name of the DC in this function, but we fill in the char* @@ -1593,14 +1597,18 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, num_dcs); } - SAFE_FREE(ip_list); + TALLOC_FREE(ip_list); TALLOC_FREE(sitename); iplist_size = 0; } /* Now we add DCs from the main AD DNS lookup. */ - get_sorted_dc_list(domain->alt_name, NULL, &ip_list, - &iplist_size, True); + (void)get_sorted_dc_list_talloc(mem_ctx, + domain->alt_name, + NULL, + &ip_list, + &iplist_size, + true); for ( i=0; iname, NULL, &ip_list, &iplist_size, - false); + (void)get_sorted_dc_list_talloc(mem_ctx, + domain->name, + NULL, + &ip_list, + &iplist_size, + false); if (iplist_size == 0) { if (domain->alt_name != NULL) { - get_sorted_dc_list(domain->alt_name, NULL, &ip_list, - &iplist_size, true); + (void)get_sorted_dc_list_talloc(mem_ctx, + domain->alt_name, + NULL, + &ip_list, + &iplist_size, + true); } } @@ -1642,7 +1658,7 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, num_dcs); } - SAFE_FREE(ip_list); + TALLOC_FREE(ip_list); iplist_size = 0; }