]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3484: hyperscan: delete databases upon error
authorRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 24 Jun 2022 21:11:19 +0000 (21:11 +0000)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 24 Jun 2022 21:11:19 +0000 (21:11 +0000)
Merge in SNORT/snort3 from ~RUCOMBS/snort3:hs_db_err to master

Squashed commit of the following:

commit 15d0fd1b9fe26fc2cd5b873726f51b013daecc2f
Author: russ <rucombs@cisco.com>
Date:   Wed Jun 22 11:11:08 2022 -0400

    hyperscan: delete databases upon error

src/detection/fp_utils.cc

index e60e2ffe5ff31fdd89e4bb78ac47478b4d2c4645..33fdd8b8af6efc3dd309e0adbb80f00bd43665f2 100644 (file)
@@ -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;