diff options
author | Volker Lendecke <vl@samba.org> | 2010-02-20 15:27:48 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-02-22 23:23:20 +0100 |
commit | 82f6f3920c3127caf5e32de4c81830e74300e0f8 (patch) | |
tree | 0cc14307aff0b468682867f64afee12080893928 /source3/libsmb | |
parent | 964210b89a9438356c3c37a4f9d227ce6cf09c8f (diff) | |
download | samba-82f6f3920c3127caf5e32de4c81830e74300e0f8.tar.gz samba-82f6f3920c3127caf5e32de4c81830e74300e0f8.tar.bz2 samba-82f6f3920c3127caf5e32de4c81830e74300e0f8.zip |
s3: Explicitly handle inbuf in cli_trans_done
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clitrans.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 48993f01c0..56580e6a6d 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -1106,6 +1106,7 @@ static void cli_trans_done(struct tevent_req *subreq) uint16_t *vwv; uint32_t num_bytes; uint8_t *bytes; + uint8_t *inbuf; uint8_t num_setup = 0; uint16_t *setup = NULL; uint32_t total_param = 0; @@ -1117,8 +1118,12 @@ static void cli_trans_done(struct tevent_req *subreq) uint8_t *param = NULL; uint8_t *data = NULL; - status = cli_smb_recv(subreq, NULL, NULL, 0, &wct, &vwv, + status = cli_smb_recv(subreq, state, &inbuf, 0, &wct, &vwv, &num_bytes, &bytes); + /* + * Do not TALLOC_FREE(subreq) here, we might receive more than + * one response for the same mid. + */ /* * We can receive something like STATUS_MORE_ENTRIES, so don't use @@ -1133,7 +1138,7 @@ static void cli_trans_done(struct tevent_req *subreq) && (state->data_sent == state->num_data)); status = cli_pull_trans( - cli_smb_inbuf(subreq), wct, vwv, num_bytes, bytes, + inbuf, wct, vwv, num_bytes, bytes, state->cmd, !sent_all, &num_setup, &setup, &total_param, &num_param, ¶m_disp, ¶m, &total_data, &num_data, &data_disp, &data); @@ -1192,6 +1197,8 @@ static void cli_trans_done(struct tevent_req *subreq) return; } + TALLOC_FREE(inbuf); + if (!cli_smb_req_set_pending(subreq)) { status = NT_STATUS_NO_MEMORY; goto fail; |