]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Fix debug print of excluderegex if NULL 3893/head
authorSoner Tari <sonertari@gmail.com>
Mon, 19 Jul 2021 14:31:51 +0000 (17:31 +0300)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 14:31:51 +0000 (17:31 +0300)
excluderegex in logparser plugin is optional, hence can be NULL. If debug is enabled, debug print causes a CRITICAL error log like vfprintf %s NULL in "utils_match: match_create_callback: regex = %s, excluderegex = %s"

src/utils/match/match.c

index a287606954fa58ffedb0fd4827c5bda170ae94a5..e07893b30958ba6c2618506b8de7b2efd9b60fa7 100644 (file)
@@ -204,7 +204,7 @@ match_create_callback(const char *regex, const char *excluderegex,
   int status;
 
   DEBUG("utils_match: match_create_callback: regex = %s, excluderegex = %s",
-        regex, excluderegex);
+        regex, excluderegex != NULL ? excluderegex : "");
 
   obj = calloc(1, sizeof(*obj));
   if (obj == NULL)