]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4647: file_api: making sha256 point to null to avoid dangling cases
authorSumit Kumar (sumikum7) <sumikum7@cisco.com>
Wed, 5 Mar 2025 06:28:53 +0000 (06:28 +0000)
committerLokesh Bevinamarad (lbevinam) <lbevinam@cisco.com>
Wed, 5 Mar 2025 06:28:53 +0000 (06:28 +0000)
Merge in SNORT/snort3 from ~SUMIKUM7/snort3:sdwan_fix_on_master_780 to master

Squashed commit of the following:

commit 46292646970137ee5d7499d53de1eec36924b7dc
Author: Sumit Kumar <sumikum7@cisco.com>
Date:   Mon Mar 3 16:43:12 2025 +0530

    file_api: making sha256 point to null to avoid dangling cases

src/file_api/file_lib.cc

index 192bce037f412ecda1c3b8494e11ea1b87d0af34..aef805a1cf2eaa17c3b062077fe9bd83a5f21f35 100644 (file)
@@ -110,8 +110,10 @@ FileInfo::~FileInfo ()
         user_file_data_mutex.unlock();
     }
 
-    if (sha256)
+    if (sha256) {
         delete[] sha256;
+        sha256 = nullptr;
+    }
 }
 
 void FileInfo::copy(const FileInfo& other, bool clear_data)