summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-08-13 16:15:16 +0200
committerJeremy Allison <jra@samba.org>2021-08-24 17:32:28 +0000
commit2a4e785040dbdc687061afa246b56fb07802f0e7 (patch)
treeea00bb6f465add2d7368dfb375acfb1584fa5b40
parent106c04689e1855e5631f0a10e685c55134315a26 (diff)
downloadsamba-2a4e785040dbdc687061afa246b56fb07802f0e7.tar.gz
rpc_client: Adapt rpc_api_pipe_req_send() to talloc_req conventions
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/rpc_client/cli_pipe.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 0e01ce1c139..217bbf63ed0 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1327,18 +1327,18 @@ static struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
if (cli->max_xmit_frag < DCERPC_REQUEST_LENGTH
+ RPC_MAX_SIGN_SIZE) {
/* Server is screwed up ! */
- status = NT_STATUS_INVALID_PARAMETER;
- goto post_status;
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return tevent_req_post(req, ev);
}
status = prepare_verification_trailer(state);
- if (!NT_STATUS_IS_OK(status)) {
- goto post_status;
+ if (tevent_req_nterror(req, status)) {
+ return tevent_req_post(req, ev);
}
status = prepare_next_frag(state, &is_last_frag);
- if (!NT_STATUS_IS_OK(status)) {
- goto post_status;
+ if (tevent_req_nterror(req, status)) {
+ return tevent_req_post(req, ev);
}
if (is_last_frag) {
@@ -1346,28 +1346,21 @@ static struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
&state->rpc_out,
DCERPC_PKT_RESPONSE,
state->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_api_pipe_req_done, req);
} else {
subreq = rpc_write_send(state, ev, cli->transport,
state->rpc_out.data,
state->rpc_out.length);
- if (subreq == NULL) {
- goto fail;
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
}
tevent_req_set_callback(subreq, rpc_api_pipe_req_write_done,
req);
}
return req;
-
- post_status:
- tevent_req_nterror(req, status);
- return tevent_req_post(req, ev);
- fail:
- TALLOC_FREE(req);
- return NULL;
}
static NTSTATUS prepare_verification_trailer(struct rpc_api_pipe_req_state *state)