1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:libsmb: Pass a memory context to cli_start_connection_recv()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Andreas Schneider 2023-10-31 15:05:35 +01:00 committed by Volker Lendecke
parent bbb21797bf
commit f3fda1e440

View File

@ -2946,6 +2946,7 @@ static void cli_start_connection_done(struct tevent_req *subreq)
}
static NTSTATUS cli_start_connection_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
struct cli_state **output_cli)
{
struct cli_start_connection_state *state = tevent_req_data(
@ -2955,7 +2956,7 @@ static NTSTATUS cli_start_connection_recv(struct tevent_req *req,
if (tevent_req_is_nterror(req, &status)) {
return status;
}
*output_cli = talloc_move(NULL, &state->cli);
*output_cli = talloc_move(mem_ctx, &state->cli);
return NT_STATUS_OK;
}
@ -2982,7 +2983,7 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli,
if (!tevent_req_poll_ntstatus(req, ev, &status)) {
goto fail;
}
status = cli_start_connection_recv(req, output_cli);
status = cli_start_connection_recv(req, NULL, output_cli);
fail:
TALLOC_FREE(ev);
return status;
@ -3508,7 +3509,7 @@ static void cli_full_connection_creds_conn_done(struct tevent_req *subreq)
req, struct cli_full_connection_creds_state);
NTSTATUS status;
status = cli_start_connection_recv(subreq, &state->cli);
status = cli_start_connection_recv(subreq, state, &state->cli);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
@ -3798,7 +3799,7 @@ NTSTATUS cli_full_connection_creds_recv(struct tevent_req *req,
if (tevent_req_is_nterror(req, &status)) {
return status;
}
*output_cli = state->cli;
*output_cli = talloc_move(NULL, &state->cli);
talloc_set_destructor(state, NULL);
return NT_STATUS_OK;
}