Skip to content

Commit

Permalink
If rule compilation fails, return immediately
Browse files Browse the repository at this point in the history
There's no need to populate rulesets with the output if compilation
failed.

Signed-off-by: Mark Stemm <[email protected]>
  • Loading branch information
mstemm authored and poiana committed Jun 25, 2024
1 parent adeca79 commit a3bf8b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions userspace/engine/falco_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a3bf8b4

Please sign in to comment.