diff --git a/userspace/engine/falco_common.h b/userspace/engine/falco_common.h index b7ea9d67..72098e7c 100644 --- a/userspace/engine/falco_common.h +++ b/userspace/engine/falco_common.h @@ -45,8 +45,8 @@ struct falco_exception : std::exception } explicit falco_exception(std::string error_str) + : m_error_str(error_str) { - m_error_str = error_str; } char const* what() const throw() diff --git a/userspace/falco/app/state.h b/userspace/falco/app/state.h index 188cd715..a392c96e 100644 --- a/userspace/falco/app/state.h +++ b/userspace/falco/app/state.h @@ -72,18 +72,18 @@ struct state state(): restart(false), + config(std::make_shared()), + outputs(nullptr), + engine(std::make_shared()), loaded_sources(), enabled_sources(), + offline_inspector(std::make_shared()), source_infos(), plugin_configs(), selected_sc_set(), - syscall_buffer_bytes_size(DEFAULT_DRIVER_BUFFER_BYTES_DIM) + syscall_buffer_bytes_size(DEFAULT_DRIVER_BUFFER_BYTES_DIM), + restarter(nullptr) { - config = std::make_shared(); - engine = std::make_shared(); - offline_inspector = std::make_shared(); - outputs = nullptr; - restarter = nullptr; } state(const std::string& cmd, const falco::app::options& opts): state() diff --git a/userspace/falco/stats_writer.cpp b/userspace/falco/stats_writer.cpp index 7a643052..0e763155 100644 --- a/userspace/falco/stats_writer.cpp +++ b/userspace/falco/stats_writer.cpp @@ -169,9 +169,10 @@ stats_writer::ticker_t stats_writer::get_ticker() stats_writer::stats_writer( const std::shared_ptr& outputs, const std::shared_ptr& config) - : m_initialized(false), m_total_samples(0) + : m_initialized(false) + , m_total_samples(0) + , m_config(config) { - m_config = config; if (config->m_metrics_enabled) { /* m_outputs should always be initialized because we use it diff --git a/userspace/falco/versions_info.cpp b/userspace/falco/versions_info.cpp index 84719729..6ebecfda 100644 --- a/userspace/falco/versions_info.cpp +++ b/userspace/falco/versions_info.cpp @@ -49,14 +49,15 @@ static inline std::string get_driver_schema_version(const std::shared_ptr } falco::versions_info::versions_info(const std::shared_ptr& inspector) + : falco_version(FALCO_VERSION) + , engine_version(FALCO_ENGINE_VERSION) + , libs_version(FALCOSECURITY_LIBS_VERSION) + , plugin_api_version(inspector->get_plugin_api_version()) + , driver_api_version(get_driver_api_version(inspector)) + , driver_schema_version(get_driver_schema_version(inspector)) + , default_driver_version(DRIVER_VERSION) + { - falco_version = FALCO_VERSION; - engine_version = FALCO_ENGINE_VERSION; - libs_version = FALCOSECURITY_LIBS_VERSION; - plugin_api_version = inspector->get_plugin_api_version(); - driver_api_version = get_driver_api_version(inspector); - driver_schema_version = get_driver_schema_version(inspector); - default_driver_version = DRIVER_VERSION; for (const auto &p : inspector->get_plugin_manager()->plugins()) { plugin_versions[p->name()] = p->plugin_version().as_string();