From 973ca8a5c01afef49a774cca49d4b0000b29f366 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 26 Aug 2020 12:19:31 -0700 Subject: [PATCH] s3: libsmb: Cleanup - use early return in get_dc_list(). No logic change. Makes later code changes clearer. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- source3/libsmb/namequery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 06472dcffb5..a70837db2ba 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -3832,9 +3832,10 @@ static NTSTATUS get_dc_list(const char *domain, status = NT_STATUS_INVALID_PARAMETER; goto out; } - if (NT_STATUS_IS_OK(status)) { - *ret_count = (size_t)tmp_count; + if (!NT_STATUS_IS_OK(status)) { + goto out; } + *ret_count = (size_t)tmp_count; goto out; } -- 2.47.3