From 161728ebc9765fe72685b2ff9ad3c9e67ea393d2 Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Mon, 19 Jul 2021 17:31:51 +0300 Subject: [PATCH] Fix debug print of excluderegex if NULL 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/match/match.c b/src/utils/match/match.c index a28760695..e07893b30 100644 --- a/src/utils/match/match.c +++ b/src/utils/match/match.c @@ -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) -- 2.47.2