From 21de9077a52d4f0ff6e85710d26e971e2d3866d4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Sep 2020 18:19:07 -0700 Subject: [PATCH] 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 --- source3/libsmb/namequery.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.47.3