]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_client: Adapt rpc_pipe_bind_send() to talloc_req conventions
authorVolker Lendecke <vl@samba.org>
Fri, 13 Aug 2021 13:51:07 +0000 (15:51 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 24 Aug 2021 17:32:28 +0000 (17:32 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_client/cli_pipe.c

index 8ddb45742e9964e910c1723262e5001beffcfd15..0f4526688baf863e50115899b4bd1c6b99c04946 100644 (file)
@@ -1881,23 +1881,17 @@ struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
 
        if (!NT_STATUS_IS_OK(status) &&
            !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-               goto post_status;
+               tevent_req_nterror(req, status);
+               return tevent_req_post(req, ev);
        }
 
        subreq = rpc_api_pipe_send(state, ev, cli, &state->rpc_out,
                                   DCERPC_PKT_BIND_ACK, state->rpc_call_id);
-       if (subreq == NULL) {
-               goto fail;
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
        tevent_req_set_callback(subreq, rpc_pipe_bind_step_one_done, req);
        return req;
-
- post_status:
-       tevent_req_nterror(req, status);
-       return tevent_req_post(req, ev);
- fail:
-       TALLOC_FREE(req);
-       return NULL;
 }
 
 static void rpc_pipe_bind_step_one_done(struct tevent_req *subreq)