analyzer/protocol/dns: change runtime check to assert()

If it were legal to call SendReplyOrRejectEvent() without an
EventHandlerPtr, then this would leak the `question_name` object.  But
this method has just one caller, and it verifies the EventHandlerPtr.
This commit is contained in:
Max Kellermann 2020-02-16 19:11:10 +01:00
parent dd377fffba
commit aac3de576f

View file

@ -1415,14 +1415,15 @@ void DNS_Interpreter::SendReplyOrRejectEvent(DNS_MsgInfo* msg,
RR_Type qtype = RR_Type(ExtractShort(data, len)); RR_Type qtype = RR_Type(ExtractShort(data, len));
int qclass = ExtractShort(data, len); int qclass = ExtractShort(data, len);
if ( event ) assert(event);
analyzer->ConnectionEventFast(event, {
analyzer->BuildConnVal(), analyzer->ConnectionEventFast(event, {
msg->BuildHdrVal(), analyzer->BuildConnVal(),
new StringVal(question_name), msg->BuildHdrVal(),
val_mgr->GetCount(qtype), new StringVal(question_name),
val_mgr->GetCount(qclass), val_mgr->GetCount(qtype),
}); val_mgr->GetCount(qclass),
});
} }