]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-tx: small cleanups and scan-build suppression
authorVictor Julien <victor@inliniac.net>
Wed, 31 May 2017 11:33:27 +0000 (13:33 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 1 Jun 2017 05:33:04 +0000 (07:33 +0200)
src/output-tx.c

index b9c869c3aeadc7a2ff958feed147e66d5a9dc550..ad0b74366e4114b2dd66015053ac9d5622ec8fcb 100644 (file)
@@ -136,18 +136,10 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data)
     }
 
     OutputLoggerThreadData *op_thread_data = (OutputLoggerThreadData *)thread_data;
-    OutputTxLogger *logger = list;
-    OutputLoggerThreadStore *store = op_thread_data->store;
-#ifdef DEBUG_VALIDATION
-    BUG_ON(logger == NULL && store != NULL);
-    BUG_ON(logger != NULL && store == NULL);
-    BUG_ON(logger == NULL && store == NULL);
-#endif
     if (p->flow == NULL)
         return TM_ECODE_OK;
 
     Flow * const f = p->flow;
-
     const AppProto alproto = f->alproto;
 
     if (AppLayerParserProtocolIsTxAware(p->proto, alproto) == 0)
@@ -192,9 +184,13 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data)
         SCLogDebug("tx_progress_ts %d tx_progress_tc %d",
                 tx_progress_ts, tx_progress_tc);
 
-        // call each logger here (pseudo code)
-        logger = list;
-        store = op_thread_data->store;
+        const OutputTxLogger *logger = list;
+        const OutputLoggerThreadStore *store = op_thread_data->store;
+#ifdef DEBUG_VALIDATION
+        BUG_ON(logger == NULL && store != NULL);
+        BUG_ON(logger != NULL && store == NULL);
+        BUG_ON(logger == NULL && store == NULL);
+#endif
         while (logger && store) {
             BUG_ON(logger->LogFunc == NULL);