diff --git a/src/flow-manager.c b/src/flow-manager.c index e1d8993556..40654f813e 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -392,20 +392,22 @@ static void FlowManagerHashRowTimeout(FlowManagerTimeoutThread *td, Flow *next_flow = f->next; - counters->flows_timeout++; - /* never prune a flow that is used by a packet we * are currently processing in one of the threads */ if (f->use_cnt > 0 || !FlowBypassedTimeout(f, ts, counters)) { FLOWLOCK_UNLOCK(f); prev_f = f; - counters->flows_timeout_inuse++; + if (f->use_cnt > 0) { + counters->flows_timeout_inuse++; + } f = f->next; continue; } f->flow_end_flags |= FLOW_END_FLAG_TIMEOUT; + counters->flows_timeout++; + RemoveFromHash(f, prev_f); FlowQueuePrivateAppendFlow(&td->aside_queue, f);