X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Futils_latency.c;h=2fb3f83342a0e85fbea3c72c7e2a2f23dcf2cbb2;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=ca7d5fab3d582672554f344fb9ed60791fdbb1f1;hpb=b286b677bb54a3192a4121c2aa0857a133fd0603;p=collectd.git diff --git a/src/utils_latency.c b/src/utils_latency.c index ca7d5fab..2fb3f833 100644 --- a/src/utils_latency.c +++ b/src/utils_latency.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "utils_latency.h" #include "common.h" @@ -121,10 +122,9 @@ latency_counter_t *latency_counter_create (void) /* {{{ */ { latency_counter_t *lc; - lc = malloc (sizeof (*lc)); + lc = calloc (1, sizeof (*lc)); if (lc == NULL) return (NULL); - memset (lc, 0, sizeof (*lc)); latency_counter_reset (lc); lc->bin_width = HISTOGRAM_DEFAULT_BIN_WIDTH;