From: Jeremy Allison Date: Wed, 26 Aug 2020 19:19:31 +0000 (-0700) Subject: s3: libsmb: Cleanup - use early return in get_dc_list(). X-Git-Tag: talloc-2.3.2~611 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=973ca8a5c01afef49a774cca49d4b0000b29f366;p=thirdparty%2Fsamba.git 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 --- 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; }