From 5e3f072fa6111d766e38ec743648206481876ad6 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 20 Feb 2010 12:27:07 +0100 Subject: [PATCH] Clean up flow mutexes after use. --- src/flow-util.c | 1 + src/flow.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/flow-util.c b/src/flow-util.c index 82a9faa420..2bb958ecfa 100644 --- a/src/flow-util.c +++ b/src/flow-util.c @@ -47,6 +47,7 @@ void FlowFree(Flow *f) flow_memuse -= sizeof(Flow); SCMutexUnlock(&flow_memuse_mutex); + SCMutexDestroy(&f->m); SCFree(f); } diff --git a/src/flow.c b/src/flow.c index af75315557..fcf90d90e9 100644 --- a/src/flow.c +++ b/src/flow.c @@ -575,6 +575,7 @@ void FlowPrintQueueInfo (void) void FlowShutdown(void) { Flow *f; int i; + uint32_t u; while((f = FlowDequeue(&flow_spare_q))) { FlowFree(f); @@ -598,6 +599,10 @@ void FlowShutdown(void) { } if (flow_hash != NULL) { + /* clean up flow mutexes */ + for (u = 0; u < flow_config.hash_size; u++) { + SCMutexDestroy(&flow_hash[u].m); + } SCFree(flow_hash); flow_hash = NULL; }