]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
cldap: Save a few lines in cldap_netlogon
authorVolker Lendecke <vl@samba.org>
Thu, 24 Oct 2024 11:59:42 +0000 (13:59 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 25 Oct 2024 09:04:11 +0000 (09:04 +0000)
Follow recent convention to write sync wrappers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct 25 09:04:11 UTC 2024 on atb-devel-224

libcli/cldap/cldap.c

index cf8d020c5e396a911f26cc5bea6b10d15ae4d131..022bb2bfa21fa8de7c4c52afb729728e48deef29 100644 (file)
@@ -1069,7 +1069,7 @@ NTSTATUS cldap_netlogon(struct cldap_socket *cldap,
        TALLOC_CTX *frame;
        struct tevent_req *req;
        struct tevent_context *ev;
-       NTSTATUS status;
+       NTSTATUS status = NT_STATUS_NO_MEMORY;
 
        if (cldap->searches.list) {
                return NT_STATUS_PIPE_BUSY;
@@ -1083,29 +1083,22 @@ NTSTATUS cldap_netlogon(struct cldap_socket *cldap,
 
        ev = samba_tevent_context_init(frame);
        if (ev == NULL) {
-               TALLOC_FREE(frame);
-               return NT_STATUS_NO_MEMORY;
+               goto done;
        }
-
        req = cldap_netlogon_send(mem_ctx, ev, cldap, io);
        if (req == NULL) {
-               TALLOC_FREE(frame);
-               return NT_STATUS_NO_MEMORY;
+               goto done;
        }
-
        if (!tevent_req_poll_ntstatus(req, ev, &status)) {
-               TALLOC_FREE(frame);
-               return status;
+               goto done;
        }
-
        status = cldap_netlogon_recv(req, mem_ctx, io);
        if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(frame);
-               return status;
+               goto done;
        }
-
+done:
        TALLOC_FREE(frame);
-       return NT_STATUS_OK;
+       return status;
 }