From: Soner Tari Date: Mon, 19 Jul 2021 14:31:51 +0000 (+0300) Subject: Fix debug print of excluderegex if NULL X-Git-Tag: 6.0.0-rc0~130^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3893%2Fhead;p=thirdparty%2Fcollectd.git 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" --- 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)