]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smb: explicity free files
authorVictor Julien <vjulien@oisf.net>
Fri, 20 Jan 2023 17:50:38 +0000 (18:50 +0100)
committerVictor Julien <vjulien@oisf.net>
Mon, 23 Jan 2023 08:19:47 +0000 (09:19 +0100)
In preparation of adding an argument to the free functions which
means the drop trait can't be used anymore.

rust/src/smb/smb.rs

index e811d139219ecfbff48535d15ae4ffe220d46793..9979fc52e3f6c1f44c267d3ec378d3fcca937258 100644 (file)
@@ -528,6 +528,10 @@ impl SMBTransaction {
 
 impl Drop for SMBTransaction {
     fn drop(&mut self) {
+        if let Some(SMBTransactionTypeData::FILE(ref mut tdf)) = self.type_data {
+            tdf.files.files_ts.free();
+            tdf.files.files_tc.free();
+        }
         self.free();
     }
 }