/**
* collectd - src/utils_latency.c
- * Copyright (C) 2013 Florian Forster
+ * Copyright (C) 2013 Florian Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* Florian Forster <ff at octo.it>
**/
-#include <math.h>
-#include <limits.h>
-
#include "collectd.h"
#include "plugin.h"
#include "utils_latency.h"
#include "common.h"
+#include <math.h>
+#include <limits.h>
+
#ifndef LLONG_MAX
# define LLONG_MAX 9223372036854775807LL
#endif
{
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;