From: Victor Julien Date: Tue, 20 Mar 2012 09:13:52 +0000 (+0100) Subject: flow: fix atomic var not being initialized and destroyed. X-Git-Tag: suricata-1.3beta1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b79dac2b746c85e66c1e3eb68ac8db18757f828;p=thirdparty%2Fsuricata.git flow: fix atomic var not being initialized and destroyed. --- 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)