Fix mem leak and unchecked dynamic cast reported by Coverity.

This commit is contained in:
Jon Siwek 2014-03-31 16:32:58 -05:00
parent b2f8196dc2
commit acc721c36c
2 changed files with 6 additions and 5 deletions

View file

@ -686,6 +686,10 @@ RuleMatcher::MIME_Matches* RuleMatcher::Match(RuleFileMagicState* state,
loop_over_list(r->actions, rai)
{
const RuleActionMIME* ram = dynamic_cast<const RuleActionMIME*>(r->actions[rai]);
if ( ! ram )
continue;
set<string>& ss = (*rval)[ram->GetStrength()];
ss.insert(ram->GetMIME());
}