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
{
reporter->InternalWarning("bad IP version in fragment reassembly: %d",
version);
delete [] pkt_start;
}
}
void FragReassembler::Expire(double t)

View file

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

View file

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

View file

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