X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=inline;f=src%2Fmatch_hashed.c;h=79f79face14d6bc35bd856c51de8f41f92dd6ea6;hb=005a70ad7863229b8c60e8ca83b67e89dfb05ad0;hp=ba0c47c3f30275ce422f30b6fa717b0bb0d761cf;hpb=81a5fd5046c6a39f580a8fc1a3af837fd5f5aa5c;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++) {