mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-06 17:20:49 +00:00
fix(userspace/engine): free formatters, if any
Previously, formatters were freed by LUA code when re-opening outputs. Since now, outputs are not controlling anymore the falco_formats class (see #1412), we just free formatters only if were already initialized. That is needed when the engine restarts (see #1446). By doing so, we also ensure that correct inspector instance is set to the formatter cache. Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
@@ -44,8 +44,9 @@ void falco_formats::init(sinsp *inspector,
|
|||||||
s_json_include_output_property = json_include_output_property;
|
s_json_include_output_property = json_include_output_property;
|
||||||
if(!s_formatters)
|
if(!s_formatters)
|
||||||
{
|
{
|
||||||
s_formatters = new sinsp_evt_formatter_cache(s_inspector);
|
delete(s_formatters);
|
||||||
}
|
}
|
||||||
|
s_formatters = new sinsp_evt_formatter_cache(s_inspector);
|
||||||
|
|
||||||
luaL_openlib(ls, "formats", ll_falco, 0);
|
luaL_openlib(ls, "formats", ll_falco, 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user