]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libads: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().
authorJeremy Allison <jra@samba.org>
Wed, 26 Aug 2020 18:50:46 +0000 (11:50 -0700)
committerNoel Power <npower@samba.org>
Mon, 7 Sep 2020 13:23:41 +0000 (13:23 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/libads/ldap.c

index 1925220515eeb2154775d7cd05bcb2fc3dce61b0..626ae75d8df2230e10815c0880340723b60b9e51 100755 (executable)
@@ -391,8 +391,12 @@ static NTSTATUS resolve_and_ping_netbios(ADS_STRUCT *ads,
        DEBUG(6, ("resolve_and_ping_netbios: (cldap) looking for domain '%s'\n",
                  domain));
 
-       status = get_sorted_dc_list(domain, NULL, &ip_list, &count,
-                                   false);
+       status = get_sorted_dc_list_talloc(talloc_tos(),
+                               domain,
+                               NULL,
+                               &ip_list,
+                               &count,
+                               false);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -418,7 +422,7 @@ static NTSTATUS resolve_and_ping_netbios(ADS_STRUCT *ads,
 
        status = cldap_ping_list(ads, domain, ip_list, count);
 
-       SAFE_FREE(ip_list);
+       TALLOC_FREE(ip_list);
 
        return status;
 }
@@ -438,16 +442,20 @@ static NTSTATUS resolve_and_ping_dns(ADS_STRUCT *ads, const char *sitename,
        DEBUG(6, ("resolve_and_ping_dns: (cldap) looking for realm '%s'\n",
                  realm));
 
-       status = get_sorted_dc_list(realm, sitename, &ip_list, &count,
-                                   true);
+       status = get_sorted_dc_list_talloc(talloc_tos(),
+                               realm,
+                               sitename,
+                               &ip_list,
+                               &count,
+                               true);
        if (!NT_STATUS_IS_OK(status)) {
-               SAFE_FREE(ip_list);
+               TALLOC_FREE(ip_list);
                return status;
        }
 
        status = cldap_ping_list(ads, realm, ip_list, count);
 
-       SAFE_FREE(ip_list);
+       TALLOC_FREE(ip_list);
 
        return status;
 }