]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2356 in SNORT/snort3 from ~NEHASH4/snort3:flow_fix to master
authorBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Tue, 4 Aug 2020 06:49:16 +0000 (06:49 +0000)
committerBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Tue, 4 Aug 2020 06:49:16 +0000 (06:49 +0000)
Squashed commit of the following:

commit 6b6d8d037c4ab324336eaad20011f4c4de9a337b
Author: Neha Sharma <nehash4@cisco.com>
Date:   Wed Jul 29 07:26:25 2020 -0400

    flow: fixing free_flow_data logic

src/flow/flow.cc

index fd7cd595ab000a8bda829294c6688490adc0a9a4..3dc36b39c219f4381955a093231cfd222de58617 100644 (file)
@@ -301,16 +301,13 @@ void Flow::free_flow_data(uint32_t proto)
 
 void Flow::free_flow_data()
 {
-    FlowData* fd = flow_data;
-
-    while (fd)
+    while (flow_data)
     {
-        FlowData* tmp = fd;
-        fd = fd->next;
+        FlowData* tmp = flow_data;
+        flow_data = flow_data->next;
         tmp->update_deallocations(tmp->size_of());
         delete tmp;
     }
-    flow_data = nullptr;
 }
 
 void Flow::call_handlers(Packet* p, bool eof)