From: Ken Steele Date: Wed, 19 Nov 2014 18:48:41 +0000 (-0500) Subject: Correct flow memory usage bookkeeping error X-Git-Tag: suricata-2.1beta3~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e6c4e94b8b7e5d61ea7062ff21d2678bedde32;p=thirdparty%2Fsuricata.git Correct flow memory usage bookkeeping error Fix bug 1321 where flow_memuse was incremented more on allocation than free. --- diff --git a/src/flow-util.c b/src/flow-util.c index 7bd685743a..b4b54c188e 100644 --- a/src/flow-util.c +++ b/src/flow-util.c @@ -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); } /**