/* Unmarshall the RPC header */
if (!smb_io_rpc_hdr("hdr", &hdr, &reply_pdu, 0)) {
DEBUG(0, ("rpc_pipe_bind: failed to unmarshall RPC_HDR.\n"));
+ prs_mem_free(&reply_pdu);
async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL);
return;
}
if (!smb_io_rpc_hdr_ba("", &hdr_ba, &reply_pdu, 0)) {
DEBUG(0, ("rpc_pipe_bind: Failed to unmarshall "
"RPC_HDR_BA.\n"));
+ prs_mem_free(&reply_pdu);
async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL);
return;
}
if (!check_bind_response(&hdr_ba, &state->cli->transfer_syntax)) {
DEBUG(2, ("rpc_pipe_bind: check_bind_response failed.\n"));
+ prs_mem_free(&reply_pdu);
async_req_error(req, NT_STATUS_BUFFER_TOO_SMALL);
return;
}
case PIPE_AUTH_TYPE_NONE:
case PIPE_AUTH_TYPE_SCHANNEL:
/* Bind complete. */
+ prs_mem_free(&reply_pdu);
async_req_done(req);
break;
/* Need to send AUTH3 packet - no reply. */
status = rpc_finish_auth3_bind_send(req, state, &hdr,
&reply_pdu);
+ prs_mem_free(&reply_pdu);
if (!NT_STATUS_IS_OK(status)) {
async_req_error(req, status);
}
/* Need to send alter context request and reply. */
status = rpc_finish_spnego_ntlmssp_bind_send(req, state, &hdr,
&reply_pdu);
+ prs_mem_free(&reply_pdu);
if (!NT_STATUS_IS_OK(status)) {
async_req_error(req, status);
}
default:
DEBUG(0,("cli_finish_bind_auth: unknown auth type %u\n",
(unsigned int)state->cli->auth->auth_type));
+ prs_mem_free(&reply_pdu);
async_req_error(req, NT_STATUS_INTERNAL_ERROR);
}
}