From 3b79dac2b746c85e66c1e3eb68ac8db18757f828 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 20 Mar 2012 10:13:52 +0100 Subject: [PATCH] flow: fix atomic var not being initialized and destroyed. --- src/flow-util.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flow-util.h b/src/flow-util.h index 57bcbf7e94..a8d4dd5820 100644 --- a/src/flow-util.h +++ b/src/flow-util.h @@ -62,6 +62,7 @@ (f)->hprev = NULL; \ (f)->lnext = NULL; \ (f)->lprev = NULL; \ + SC_ATOMIC_INIT((f)->autofp_tmqh_flow_qid); \ SC_ATOMIC_SET((f)->autofp_tmqh_flow_qid, -1); \ RESET_COUNTERS((f)); \ } while (0) @@ -110,9 +111,7 @@ DetectTagDataListFree((f)->tag_list); \ GenericVarFree((f)->flowvar); \ SCMutexDestroy(&(f)->de_state_m); \ - if (SC_ATOMIC_GET((f)->autofp_tmqh_flow_qid) != -1) { \ - SC_ATOMIC_DESTROY((f)->autofp_tmqh_flow_qid); \ - } \ + SC_ATOMIC_DESTROY((f)->autofp_tmqh_flow_qid); \ (f)->tag_list = NULL; \ } while(0)