X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmatch_hashed.c;h=79f79face14d6bc35bd856c51de8f41f92dd6ea6;hb=2ce1db8202b1eba6da45b347c0c81a508f8c088a;hp=ba0c47c3f30275ce422f30b6fa717b0bb0d761cf;hpb=3307054b6ab46b51fdda4f528e72d119e9de3071;p=collectd.git diff --git a/src/match_hashed.c b/src/match_hashed.c index ba0c47c3..79f79fac 100644 --- a/src/match_hashed.c +++ b/src/match_hashed.c @@ -26,7 +26,6 @@ #include "collectd.h" #include "common.h" -#include "utils_cache.h" #include "filter_chain.h" /* @@ -101,13 +100,12 @@ static int mh_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ mh_match_t *m; int i; - m = (mh_match_t *) malloc (sizeof (*m)); + m = calloc (1, sizeof (*m)); if (m == NULL) { - ERROR ("mh_create: malloc failed."); + ERROR ("mh_create: calloc failed."); return (-ENOMEM); } - memset (m, 0, sizeof (*m)); for (i = 0; i < ci->children_num; i++) {