]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Misc fixes after make check feedback
authorVictor Julien <victor@inliniac.net>
Sun, 28 Jul 2013 10:59:52 +0000 (12:59 +0200)
committerVictor Julien <victor@inliniac.net>
Sun, 28 Jul 2013 10:59:52 +0000 (12:59 +0200)
src/runmode-tile.c
src/source-mpipe.c

index 3e5e58f677312b5986ac5099705ad9df7916504f..bb5815536b902810a29ffcb21814ddc942c96801 100644 (file)
@@ -202,9 +202,17 @@ int RunModeTileMpipeWorkers(DetectEngineCtx *de_ctx)
         } else {
             mpipe_devc = SCStrdup(mpipe_dev);
         }
+        if (mpipe_devc == NULL) {
+            printf("ERROR: SCStrdup failed for ReceiveMpipe\n");
+            exit(EXIT_FAILURE);
+        }
 
         snprintf(tname, sizeof(tname), "Worker%d", pipe+1);
         thread_name = SCStrdup(tname);
+        if (thread_name == NULL) {
+            printf("ERROR: SCStrdup failed for ReceiveMpipe\n");
+            exit(EXIT_FAILURE);
+        }
 
         /* create the threads */
         ThreadVars *tv_worker =
index b98164eadc89574274ee8940efd7a2997eec7a44..e343b2edf407702e0e161c2c4a3c28ccac923b11 100644 (file)
@@ -964,10 +964,10 @@ TmEcode DecodeMpipe(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
     SCPerfCounterIncr(dtv->counter_pkts, tv->sc_perf_pca);
     SCPerfCounterIncr(dtv->counter_pkts_per_sec, tv->sc_perf_pca);
 
-    SCPerfCounterAddUI64(dtv->counter_bytes, tv->sc_perf_pca, p->pktlen);
+    SCPerfCounterAddUI64(dtv->counter_bytes, tv->sc_perf_pca, GET_PKT_LEN(p));
 
-    SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, p->pktlen);
-    SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, p->pktlen);
+    SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p));
+    SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p));
 
     /* call the decoder */
     DecodeEthernet(tv, dtv, p, GET_PKT_DATA(p), GET_PKT_LEN(p), pq);