Fix more Coverity-reported issues (introduced by internal error audit).

Mem leaks and a null pointer deref (not actually expected to occur
unless already in one of the the odd states that warrants an internal
warning/error).

Also dead code.
This commit is contained in:
Jon Siwek 2013-10-14 15:37:45 -05:00
parent 1d23f055ba
commit cf6d7ba5ae
4 changed files with 10 additions and 15 deletions

View file

@ -290,8 +290,11 @@ void FragReassembler::BlockInserted(DataBlock* /* start_block */)
} }
else else
{
reporter->InternalWarning("bad IP version in fragment reassembly: %d", reporter->InternalWarning("bad IP version in fragment reassembly: %d",
version); version);
delete [] pkt_start;
}
} }
void FragReassembler::Expire(double t) void FragReassembler::Expire(double t)

View file

@ -215,6 +215,7 @@ void TelnetAuthenticateOption::RecvSubOption(u_char* data, int len)
{ {
reporter->AnalyzerError(endp, reporter->AnalyzerError(endp,
"option peer missing in TelnetAuthenticateOption::RecvSubOption"); "option peer missing in TelnetAuthenticateOption::RecvSubOption");
return;
} }
if ( ! peer->DidRequestAuthentication() ) if ( ! peer->DidRequestAuthentication() )

View file

@ -211,6 +211,7 @@ void POP3_Analyzer::ProcessRequest(int length, const char* line)
default: default:
reporter->AnalyzerError(this, reporter->AnalyzerError(this,
"unexpected POP3 authorization state"); "unexpected POP3 authorization state");
delete decoded;
return; return;
} }

View file

@ -743,23 +743,13 @@ int SMB_Session::ParseTransaction(int is_orig, int cmd,
return 0; return 0;
} }
int ret; if ( ! is_orig )
if ( is_orig ) return ParseTransactionResponse(cmd, hdr, body);
{
if ( cmd == SMB_COM_TRANSACTION || cmd == SMB_COM_TRANSACTION2 ) if ( cmd == SMB_COM_TRANSACTION || cmd == SMB_COM_TRANSACTION2 )
ret = ParseTransactionRequest(cmd, hdr, body); return ParseTransactionRequest(cmd, hdr, body);
else if ( cmd == SMB_COM_TRANSACTION_SECONDARY || return ParseTransactionSecondaryRequest(cmd, hdr, body);
cmd == SMB_COM_TRANSACTION2_SECONDARY )
ret = ParseTransactionSecondaryRequest(cmd, hdr, body);
else
ret = 0;
}
else
ret = ParseTransactionResponse(cmd, hdr, body);
return ret;
} }
int SMB_Session::ParseTransactionRequest(int cmd, int SMB_Session::ParseTransactionRequest(int cmd,