From: Sumit Kumar (sumikum7) Date: Wed, 5 Mar 2025 06:28:53 +0000 (+0000) Subject: Pull request #4647: file_api: making sha256 point to null to avoid dangling cases X-Git-Tag: 3.7.1.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=997c509058e87005d53cea26c838f859dc839539;p=thirdparty%2Fsnort3.git Pull request #4647: file_api: making sha256 point to null to avoid dangling cases Merge in SNORT/snort3 from ~SUMIKUM7/snort3:sdwan_fix_on_master_780 to master Squashed commit of the following: commit 46292646970137ee5d7499d53de1eec36924b7dc Author: Sumit Kumar Date: Mon Mar 3 16:43:12 2025 +0530 file_api: making sha256 point to null to avoid dangling cases --- diff --git a/src/file_api/file_lib.cc b/src/file_api/file_lib.cc index 192bce037..aef805a1c 100644 --- a/src/file_api/file_lib.cc +++ b/src/file_api/file_lib.cc @@ -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)