mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-22 03:49:36 +00:00
fix(c++): don't throw outside of the try catch block in nothrow function
Reported by cppcheck Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
@@ -330,6 +330,8 @@ static void process_inspector_events(
|
|||||||
source_sync_context* sync,
|
source_sync_context* sync,
|
||||||
run_result* res) noexcept
|
run_result* res) noexcept
|
||||||
{
|
{
|
||||||
|
run_result result;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
double duration;
|
double duration;
|
||||||
@@ -342,7 +344,7 @@ static void process_inspector_events(
|
|||||||
|
|
||||||
duration = ((double)clock()) / CLOCKS_PER_SEC;
|
duration = ((double)clock()) / CLOCKS_PER_SEC;
|
||||||
|
|
||||||
*res = do_inspect(s, inspector, source, statsw, sdropmgr, check_drops_timeouts,
|
result = do_inspect(s, inspector, source, statsw, sdropmgr, check_drops_timeouts,
|
||||||
uint64_t(s.options.duration_to_tot*ONE_SECOND_IN_NS),
|
uint64_t(s.options.duration_to_tot*ONE_SECOND_IN_NS),
|
||||||
num_evts);
|
num_evts);
|
||||||
|
|
||||||
@@ -373,13 +375,21 @@ static void process_inspector_events(
|
|||||||
}
|
}
|
||||||
catch(const std::exception& e)
|
catch(const std::exception& e)
|
||||||
{
|
{
|
||||||
*res = run_result::fatal(e.what());
|
result = run_result::fatal(e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sync)
|
if (sync)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
sync->finish();
|
sync->finish();
|
||||||
}
|
}
|
||||||
|
catch(const std::exception& e)
|
||||||
|
{
|
||||||
|
result = run_result::merge(result, run_result::fatal(e.what()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*res = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static falco::app::run_result init_stats_writer(
|
static falco::app::run_result init_stats_writer(
|
||||||
|
Reference in New Issue
Block a user