1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

Fix a valgrind error in cli_ctemp_done

For performance reasons cli_smb_recv does not make copies of the buffers we
received from the client, so both "vwv" and "bytes" vanish with
TALLOC_FREE(subreq). I know this is a bit counter-intuitive, but I think in
this case it's justified not to make copies.

Comments?
This commit is contained in:
Volker Lendecke 2009-07-27 12:36:31 +02:00
parent fb03bbfa09
commit e8abc36d2a

View File

@ -4098,14 +4098,16 @@ static void cli_ctemp_done(struct tevent_req *subreq)
uint8_t *bytes = NULL;
status = cli_smb_recv(subreq, 1, &wcnt, &vwv, &num_bytes, &bytes);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(subreq);
tevent_req_nterror(req, status);
return;
}
state->fnum = SVAL(vwv+0, 0);
TALLOC_FREE(subreq);
/* From W2K3, the result is just the ASCII name */
if (num_bytes < 2) {
tevent_req_nterror(req, NT_STATUS_DATA_ERROR);