mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Fix memory leak when no protocol_violation event handler exists
This commit is contained in:
parent
7f0fb49612
commit
88278214a9
3 changed files with 8 additions and 4 deletions
|
@ -679,6 +679,9 @@ void Analyzer::ProtocolConfirmation(Tag arg_tag)
|
|||
|
||||
void Analyzer::ProtocolViolation(const char* reason, const char* data, int len)
|
||||
{
|
||||
if ( ! protocol_violation )
|
||||
return;
|
||||
|
||||
StringVal* r;
|
||||
|
||||
if ( data && len )
|
||||
|
@ -692,9 +695,6 @@ void Analyzer::ProtocolViolation(const char* reason, const char* data, int len)
|
|||
else
|
||||
r = new StringVal(reason);
|
||||
|
||||
if ( ! protocol_violation )
|
||||
return;
|
||||
|
||||
EnumVal* tval = tag.AsEnumVal();
|
||||
Ref(tval);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue