TRWPortScanDetector: Provide better error messages on bad_alloc

master
Lothar Braun 2020-05-26 21:27:35 +02:00
parent 082ea973c6
commit dd804c52ee
1 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,11 @@ TRWPortscanDetector::TRWPortscanDetector(uint32_t hashbits, uint32_t texppend,
msg(LOG_NOTICE, "TRW variables: logeta_0: %f, logeta_1: %f, X_0: %f, X_1: %f", logeta_0, logeta_1, X_0, X_1);
lastCleanup = time(0);
trwEntries = new list<TRWEntry*>[hashSize];
try {
trwEntries = new list<TRWEntry*>[hashSize];
} catch(std::bad_alloc& ba) {
THROWEXCEPTION("Error allocating TRWEntries in TRWPortscanDetector. Try reducing the number of hashbits: %s", ba.what());
}
}
TRWPortscanDetector::~TRWPortscanDetector()