From: Russ Combs (rucombs) Date: Fri, 24 Jun 2022 21:11:19 +0000 (+0000) Subject: Pull request #3484: hyperscan: delete databases upon error X-Git-Tag: 3.1.33.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82e637d491a8c492836073e16f4e95215995a959;p=thirdparty%2Fsnort3.git Pull request #3484: hyperscan: delete databases upon error Merge in SNORT/snort3 from ~RUCOMBS/snort3:hs_db_err to master Squashed commit of the following: commit 15d0fd1b9fe26fc2cd5b873726f51b013daecc2f Author: russ Date: Wed Jun 22 11:11:08 2022 -0400 hyperscan: delete databases upon error --- diff --git a/src/detection/fp_utils.cc b/src/detection/fp_utils.cc index e60e2ffe5..33fdd8b8a 100644 --- a/src/detection/fp_utils.cc +++ b/src/detection/fp_utils.cc @@ -353,11 +353,13 @@ static bool db_load(const std::string& path, const char* proto, const char* dir, if ( !fetch(file, db, len) ) { ParseWarning(WARN_RULES, "Failed to read %s", file.c_str()); + delete[] db; return false; } else if ( !it->group.normal_mpse->deserialize(db, len) ) { ParseWarning(WARN_RULES, "Failed to deserialize %s", file.c_str()); + delete[] db; return false; } delete[] db;