Comment 7 for bug 1609051

Revision history for this message
DarabosJ (darabosj) wrote :

I found the bug in the samba source in the file source3/libsmb/cliconnect.c:

NTSTATUS cli_tdis(struct cli_state *cli)
{
 struct tevent_context *ev;
 struct tevent_req *req;
 NTSTATUS status = NT_STATUS_NO_MEMORY;

 if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
  return smb2cli_tdis(cli->conn,
        cli->timeout,
        cli->smb2.session,
        cli->smb2.tcon);
 }

 if (smbXcli_conn_has_async_calls(cli->conn)) {
  return NT_STATUS_INVALID_PARAMETER;
 }
 ev = samba_tevent_context_init(talloc_tos());
 if (ev == NULL) {
  goto fail;
 }
 req = cli_tdis_send(ev, ev, cli);
 if (req == NULL) {
  goto fail;
 }
 if (!tevent_req_poll_ntstatus(req, ev, &status)) {
  goto fail;
 }
 status = cli_tdis_recv(req);
fail:
 TALLOC_FREE(ev);
 return status;
}

when the ev allocation is not possible on the fail try to free up the unallocated memory.
need to be reported to the samba team also.