]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Correct flow memory usage bookkeeping error
authorKen Steele <ken@tilera.com>
Wed, 19 Nov 2014 18:48:41 +0000 (13:48 -0500)
committerVictor Julien <victor@inliniac.net>
Fri, 5 Dec 2014 09:37:55 +0000 (10:37 +0100)
Fix bug 1321 where flow_memuse was incremented more on allocation than
free.

src/flow-util.c

index 7bd685743a41c751982dcd518b629490cd4cf9ab..b4b54c188e4518e2ca0077459ea89820fdd9b39c 100644 (file)
@@ -79,7 +79,8 @@ void FlowFree(Flow *f)
     FLOW_DESTROY(f);
     SCFree(f);
 
-    (void) SC_ATOMIC_SUB(flow_memuse, sizeof(Flow));
+    size_t size = sizeof(Flow) + FlowStorageSize();
+    (void) SC_ATOMIC_SUB(flow_memuse, size);
 }
 
 /**