From: Jeremy Allison Date: Wed, 26 Aug 2020 19:07:18 +0000 (-0700) Subject: s3: libsmb: Change to an early return in get_dc_list(). X-Git-Tag: talloc-2.3.2~613 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9bc1e59bd84b35dcb98de73be2e13bb3254415b;p=thirdparty%2Fsamba.git s3: libsmb: Change to an early return in get_dc_list(). No logic change. Will make later code changes clearer. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index b41ef23164d..f39c7382cff 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -3782,15 +3782,16 @@ static NTSTATUS get_dc_list(const char *domain, p = pserver; while (next_token_talloc(frame, &p, &name, LIST_SEP)) { if (!done_auto_lookup && strequal(name, "*")) { + done_auto_lookup = true; status = internal_resolve_name(domain, auto_name_type, sitename, &auto_ip_list, &auto_count, resolve_order); - if (NT_STATUS_IS_OK(status)) { - num_addresses += auto_count; + if (!NT_STATUS_IS_OK(status)) { + continue; } - done_auto_lookup = true; + num_addresses += auto_count; DEBUG(8,("Adding %d DC's from auto lookup\n", auto_count)); } else {