If rule compilation fails, return immediately

There's no need to populate rulesets with the output if compilation
failed.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
Mark Stemm 2024-06-24 17:52:41 -07:00 committed by poiana
parent adeca79d1c
commit a3bf8b472b

View File

@ -204,6 +204,11 @@ std::unique_ptr<load_result> falco_engine::load_rules(const std::string &rules_c
m_last_compile_output = m_rule_compiler->new_compile_output();
m_rule_compiler->compile(cfg, *m_rule_collector, *m_last_compile_output);
if(!cfg.res->successful())
{
return std::move(cfg.res);
}
// clear the rules known by the engine and each ruleset
m_rules.clear();
for (auto &src : m_sources)