summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e143132)
raw | patch | inline | side by side (parent: e143132)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:19:59 +0000 (18:19 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:19:59 +0000 (18:19 +0200) |
src/statsd.c | patch | blob | history |
diff --git a/src/statsd.c b/src/statsd.c
index d0a677e70476c79dc5fa0299c3da4af8292cdfd9..5b7a6f182e7cef26af41b8db2baeb26c55f95b47 100644 (file)
--- 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;