]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
debug: suppress cppcheck warning
authorVictor Julien <vjulien@oisf.net>
Sat, 3 May 2025 08:33:55 +0000 (10:33 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 5 May 2025 19:41:02 +0000 (21:41 +0200)
src/util-debug.c:1562:5: warning: Either the condition 'sc_lid!=NULL' is redundant or there is possible null pointer dereference: sc_lid. [nullPointerRedundantCheck]
    sc_lid->global_log_level = MAX(sc_lid->global_log_level, max_level);
    ^
src/util-debug.c:1569:16: note: Assuming that condition 'sc_lid!=NULL' is not redundant
    if (sc_lid != NULL)
               ^
src/util-debug.c:1562:5: note: Null pointer dereference
    sc_lid->global_log_level = MAX(sc_lid->global_log_level, max_level);
    ^

src/util-debug.c

index e0b7479b32e2e5cfe96ac1b5d8c65ffd6a51406b..075efac0f751052f85ab77e0dd2d1748bccdcd0c 100644 (file)
@@ -1566,8 +1566,7 @@ void SCLogLoadConfig(int daemon, int verbose, uint32_t userid, uint32_t groupid)
     SCLogDebug("sc_lc->log_format: %s", sc_log_config->log_format);
     SCLogDebug("SCLogSetOPFilter: filter: %s", sc_log_config->op_filter);
 
-    if (sc_lid != NULL)
-        SCFree(sc_lid);
+    SCFree(sc_lid);
 }
 
 /**