]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: minor compiler warnings
authorVictor Julien <vjulien@oisf.net>
Fri, 5 Aug 2022 15:10:54 +0000 (17:10 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 5 Aug 2022 17:51:07 +0000 (19:51 +0200)
flow-util.c: In function 'FlowEndCountersRegister':
flow-util.c:294:34: warning: 'name' may be used uninitialized in this function [-Wmaybe-uninitialized]
  294 |         fec->flow_tcp_state[i] = StatsRegisterCounter(name, t);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/flow-util.c

index 91c14eb3ebe60c73eca3a52b98e1093858177d8d..5caf60fc9bde8d2723ba6f0d3db0d6a52a5c3e8a 100644 (file)
@@ -265,7 +265,7 @@ void FlowEndCountersRegister(ThreadVars *t, FlowEndCounters *fec)
     }
 
     for (enum TcpState i = TCP_NONE; i <= TCP_CLOSED; i++) {
-        const char *name;
+        const char *name = NULL;
         switch (i) {
             case TCP_NONE:
                 name = "flow.end.tcp_state.none";