From: Ruben Kerkhof Date: Fri, 11 Dec 2015 22:01:06 +0000 (+0100) Subject: Merge branch 'collectd-5.5' X-Git-Tag: collectd-5.6.0~494 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=749b03b3fc459895b7415c7c13753066bf0af55b;p=collectd.git Merge branch 'collectd-5.5' --- 749b03b3fc459895b7415c7c13753066bf0af55b diff --cc src/daemon/utils_ignorelist.c index a8ca7dbb,6b5e894f..60a8c273 --- a/src/daemon/utils_ignorelist.c +++ b/src/daemon/utils_ignorelist.c @@@ -98,36 -98,41 +98,36 @@@ static int ignorelist_append_regex(igno re = malloc (sizeof (*re)); if (re == NULL) { - ERROR ("utils_ignorelist: malloc failed"); + ERROR ("ignorelist_append_regex: malloc failed."); - return ENOMEM; + return (ENOMEM); } memset (re, 0, sizeof (*re)); - /* compile regex */ - status = regcomp (re, entry, REG_EXTENDED); + status = regcomp (re, re_str, REG_EXTENDED); if (status != 0) { - char errbuf[1024] = ""; - regerror (status, re, errbuf, sizeof (errbuf)); + char errbuf[1024]; - + (void) regerror (status, re, errbuf, sizeof (errbuf)); - ERROR ("ignorelist_append_regex: Compiling regular expression \"%s\" failed: %s", entry, errbuf); + ERROR ("utils_ignorelist: regcomp failed: %s", errbuf); - regfree (re); ++ ERROR ("ignorelist_append_regex: Compiling regular expression \"%s\" failed: %s", re_str, errbuf); sfree (re); - return status; + return (status); } - /* create new entry */ - item = malloc (sizeof (*item)); - if (item == NULL) + entry = malloc (sizeof (*entry)); + if (entry == NULL) { - ERROR ("utils_ignorelist: malloc failed"); + ERROR ("ignorelist_append_regex: malloc failed."); regfree (re); sfree (re); - return ENOMEM; + return (ENOMEM); } - memset (item, 0, sizeof (*item)); - item->rmatch = re; - - /* append new entry */ - ignorelist_append (il, item); + memset (entry, 0, sizeof (*entry)); + entry->rmatch = re; + ignorelist_append (il, entry); return (0); -} /* int ignorelist_append_regex(ignorelist_t *il, const char *entry) */ +} /* int ignorelist_append_regex */ #endif static int ignorelist_append_string(ignorelist_t *il, const char *entry)