]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nfs: explicity free files
authorVictor Julien <vjulien@oisf.net>
Fri, 20 Jan 2023 17:50:18 +0000 (18:50 +0100)
committerVictor Julien <vjulien@oisf.net>
Mon, 23 Jan 2023 08:19:04 +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/nfs/nfs.rs

index f6d76ec1892f86665cad7b48202e1003e6d3aa87..9961561bd639fc08c15af08d9f8961f9f4febb4f 100644 (file)
@@ -258,6 +258,10 @@ impl Transaction for NFSTransaction {
 
 impl Drop for NFSTransaction {
     fn drop(&mut self) {
+        if let Some(NFSTransactionTypeData::FILE(ref mut tdf)) = self.type_data {
+            tdf.files.files_ts.free();
+            tdf.files.files_tc.free();
+        }
         self.free();
     }
 }