]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Fix bug in get_dc_list() introduced by ip-service cleanup.
authorJeremy Allison <jra@samba.org>
Wed, 9 Sep 2020 01:19:07 +0000 (18:19 -0700)
committerNoel Power <npower@samba.org>
Wed, 9 Sep 2020 10:31:17 +0000 (10:31 +0000)
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 <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Sep  9 10:31:17 UTC 2020 on sn-devel-184

source3/libsmb/namequery.c

index 0bcbb815a64eaffeaaa866812d5df1298883e1d6..16b554b44306c97d62967c971b6367a24d230fe1 100644 (file)
@@ -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;
        }