mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-01 22:47:46 +00:00
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:
parent
adeca79d1c
commit
a3bf8b472b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user