mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:libads: Leave early on error in get_kdc_ip_string()
This avoids useless allocations.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15016
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 313f03c784
)
This commit is contained in:
parent
c20ca210fb
commit
2599f5313b
@ -434,9 +434,14 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
struct netlogon_samlogon_response **responses = NULL;
|
struct netlogon_samlogon_response **responses = NULL;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
bool ok;
|
bool ok;
|
||||||
char *kdc_str = talloc_asprintf(mem_ctx, "%s\t\tkdc = %s\n", "",
|
char *kdc_str = NULL;
|
||||||
print_canonical_sockaddr_with_port(mem_ctx, pss));
|
|
||||||
|
|
||||||
|
SMB_ASSERT(pss != NULL);
|
||||||
|
|
||||||
|
kdc_str = talloc_asprintf(mem_ctx,
|
||||||
|
"\t\tkdc = %s\n",
|
||||||
|
print_canonical_sockaddr_with_port(mem_ctx,
|
||||||
|
pss));
|
||||||
if (kdc_str == NULL) {
|
if (kdc_str == NULL) {
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -516,15 +521,15 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dc_addrs2 = talloc_zero_array(talloc_tos(),
|
|
||||||
struct tsocket_address *,
|
|
||||||
num_dcs);
|
|
||||||
|
|
||||||
DBG_DEBUG("%zu additional KDCs to test\n", num_dcs);
|
DBG_DEBUG("%zu additional KDCs to test\n", num_dcs);
|
||||||
if (num_dcs == 0) {
|
if (num_dcs == 0) {
|
||||||
TALLOC_FREE(kdc_str);
|
TALLOC_FREE(kdc_str);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dc_addrs2 = talloc_zero_array(talloc_tos(),
|
||||||
|
struct tsocket_address *,
|
||||||
|
num_dcs);
|
||||||
if (dc_addrs2 == NULL) {
|
if (dc_addrs2 == NULL) {
|
||||||
TALLOC_FREE(kdc_str);
|
TALLOC_FREE(kdc_str);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user