Skip to content

Commit

Permalink
Added missing try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Oct 4, 2024
1 parent ee60c6e commit 58cabdd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9538,6 +9538,7 @@ bool NetworkInterface::initFlowDump(u_int8_t num_dump_interfaces) {
return (true);

if (db == NULL) {
try {
if (ntop->getPrefs()->do_dump_flows_on_clickhouse()) {
#if defined(NTOPNG_PRO) && defined(HAVE_CLICKHOUSE) && defined(HAVE_MYSQL)
db = new (std::nothrow) ClickHouseFlowDB(this);
Expand All @@ -9561,18 +9562,21 @@ bool NetworkInterface::initFlowDump(u_int8_t num_dump_interfaces) {
}
#if defined(HAVE_KAFKA) && defined(NTOPNG_PRO)
else if ((ntop->getPrefs()->getKakfaBrokersList() != NULL)) {
kafka = new KafkaProducer(this, ntop->getPrefs()->getKakfaBrokersList(),
ntop->getPrefs()->getKafkaTopic(),
ntop->getPrefs()->getKafkaOptions());
db = kafka;
}
kafka = new (std::nothrow) KafkaProducer(this, ntop->getPrefs()->getKakfaBrokersList(),
ntop->getPrefs()->getKafkaTopic(),
ntop->getPrefs()->getKafkaOptions());
db = kafka;
}
#endif
#if !defined(WIN32) && !defined(__APPLE__)
else if (ntop->getPrefs()->do_dump_flows_on_syslog()) {
db = new (std::nothrow) SyslogDump(this);
}
#endif
#endif
} catch (...) {
;
}
}

return (db != NULL);
Expand Down

0 comments on commit 58cabdd

Please sign in to comment.