X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstatsd.c;h=5b7a6f182e7cef26af41b8db2baeb26c55f95b47;hb=d0540d2ebaead6661de0ef29c0435c046c7ff4f7;hp=d0a677e70476c79dc5fa0299c3da4af8292cdfd9;hpb=ccc4feb9576f520596508418f404beb000fde1aa;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index d0a677e7..5b7a6f18 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -127,14 +127,13 @@ static statsd_metric_t *statsd_metric_lookup_unsafe (char const *name, /* {{{ */ return (NULL); } - metric = malloc (sizeof (*metric)); + metric = calloc (1, sizeof (*metric)); if (metric == NULL) { - ERROR ("statsd plugin: malloc failed."); + ERROR ("statsd plugin: calloc failed."); sfree (key_copy); return (NULL); } - memset (metric, 0, sizeof (*metric)); metric->type = type; metric->latency = NULL;