mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
Fix a memleak caused by a crappy get_sorted_dc_list() API
(This used to be commit 2ea03a1e95a30e321e390bef9408a1215711de07)
This commit is contained in:
parent
d261e16cfd
commit
bde7cbf4a7
@ -1167,9 +1167,20 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
|
|||||||
|
|
||||||
sitename = sitename_fetch(domain->alt_name);
|
sitename = sitename_fetch(domain->alt_name);
|
||||||
if (sitename) {
|
if (sitename) {
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
/* Do the site-specific AD dns lookup first. */
|
/* Do the site-specific AD dns lookup first. */
|
||||||
get_sorted_dc_list(domain->alt_name, sitename, &ip_list, &iplist_size, True);
|
status = get_sorted_dc_list(domain->alt_name,
|
||||||
|
sitename, &ip_list,
|
||||||
|
&iplist_size, True);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
/*
|
||||||
|
* Work around a crappy about-to-be-replaced
|
||||||
|
* get_sorted_dc_list error handling :-)
|
||||||
|
*/
|
||||||
|
SAFE_FREE(ip_list);
|
||||||
|
iplist_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for ( i=0; i<iplist_size; i++ ) {
|
for ( i=0; i<iplist_size; i++ ) {
|
||||||
char addr[INET6_ADDRSTRLEN];
|
char addr[INET6_ADDRSTRLEN];
|
||||||
@ -1202,6 +1213,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
|
|||||||
dcs,
|
dcs,
|
||||||
num_dcs);
|
num_dcs);
|
||||||
}
|
}
|
||||||
|
SAFE_FREE(ip_list);
|
||||||
|
iplist_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try standard netbios queries if no ADS */
|
/* try standard netbios queries if no ADS */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user