From 47c61b4f15a8b366e51bc0de0a3427eecd0d65a3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 20 Feb 2010 15:14:43 +0100 Subject: s3: Explicitly handle inbuf in cli_session_setup_guest_done --- source3/libsmb/cliconnect.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index f5e763c1f2..f24582df00 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -264,20 +264,21 @@ static void cli_session_setup_guest_done(struct tevent_req *subreq) req, struct cli_session_setup_guest_state); struct cli_state *cli = state->cli; uint32_t num_bytes; + uint8_t *in; char *inbuf; uint8_t *bytes; uint8_t *p; NTSTATUS status; - status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, + status = cli_smb_recv(subreq, state, &in, 0, NULL, NULL, &num_bytes, &bytes); + TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(subreq); tevent_req_nterror(req, status); return; } - inbuf = (char *)cli_smb_inbuf(subreq); + inbuf = (char *)in; p = bytes; cli->vuid = SVAL(inbuf, smb_uid); @@ -293,8 +294,6 @@ static void cli_session_setup_guest_done(struct tevent_req *subreq) cli->is_samba = True; } - TALLOC_FREE(subreq); - status = cli_set_username(cli, ""); if (!NT_STATUS_IS_OK(status)) { tevent_req_nterror(req, status); -- cgit