From: Jeremy Allison Date: Wed, 9 Sep 2020 01:19:07 +0000 (-0700) Subject: s3: libsmb: Fix bug in get_dc_list() introduced by ip-service cleanup. X-Git-Tag: talloc-2.3.2~564 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21de9077a52d4f0ff6e85710d26e971e2d3866d4;p=thirdparty%2Fsamba.git s3: libsmb: Fix bug in get_dc_list() introduced by ip-service cleanup. Do an early return on error. On success assign to the correct variables that are going to get copied into the 'out' parameters. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 9 10:31:17 UTC 2020 on sn-devel-184 --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 0bcbb815a64..16b554b4430 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -3960,11 +3960,11 @@ static NTSTATUS get_dc_list(TALLOC_CTX *ctx, &dc_iplist, &dc_count, resolve_order); - if (NT_STATUS_IS_OK(status)) { - *ip_list = talloc_move(ctx, &dc_iplist); - *ret_count = dc_count; + if (!NT_STATUS_IS_OK(status)) { + goto out; } - TALLOC_FREE(dc_iplist); + return_iplist = talloc_move(ctx, &dc_iplist); + local_count = dc_count; goto out; }