From d122bfc064a0265b1e08dd52bbce61caac1d6a6b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 20 Feb 2010 09:53:58 +0100 Subject: s3: Add a talloc_move for the inbuf to cli_smb_recv --- source3/libsmb/async_smb.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/libsmb/async_smb.c') diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 59226e1ecb..9f92ae7012 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -755,8 +755,9 @@ static void cli_smb_received(struct tevent_req *subreq) } } -NTSTATUS cli_smb_recv(struct tevent_req *req, uint8_t min_wct, - uint8_t *pwct, uint16_t **pvwv, +NTSTATUS cli_smb_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, uint8_t **pinbuf, + uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv, uint32_t *pnum_bytes, uint8_t **pbytes) { struct cli_smb_state *state = tevent_req_data( @@ -868,6 +869,9 @@ no_err: if (pbytes != NULL) { *pbytes = (uint8_t *)state->inbuf + bytes_offset + 2; } + if ((mem_ctx != NULL) && (pinbuf != NULL)) { + *pinbuf = talloc_move(mem_ctx, &state->inbuf); + } return status; } @@ -1055,7 +1059,8 @@ static void cli_smb_oplock_break_waiter_done(struct tevent_req *subreq) uint8_t *bytes; NTSTATUS status; - status = cli_smb_recv(subreq, 8, &wct, &vwv, &num_bytes, &bytes); + status = cli_smb_recv(subreq, NULL, NULL, 8, &wct, &vwv, + &num_bytes, &bytes); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(subreq); tevent_req_nterror(req, status); -- cgit