mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Fix mem leak and unchecked dynamic cast reported by Coverity.
This commit is contained in:
parent
b2f8196dc2
commit
acc721c36c
2 changed files with 6 additions and 5 deletions
|
@ -49,12 +49,9 @@ void File_Analyzer::Done()
|
|||
|
||||
void File_Analyzer::Identify()
|
||||
{
|
||||
RuleFileMagicState* fms = rule_matcher->InitFileMagic();
|
||||
RuleMatcher::MIME_Matches matches;
|
||||
|
||||
rule_matcher->Match(fms, reinterpret_cast<const u_char*>(buffer),
|
||||
buffer_len, &matches);
|
||||
|
||||
file_mgr->DetectMIME(reinterpret_cast<const u_char*>(buffer), buffer_len,
|
||||
&matches);
|
||||
string match = matches.empty() ? "<unknown>"
|
||||
: *(matches.begin()->second.begin());
|
||||
val_list* vl = new val_list;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue