summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d13a04d)
raw | patch | inline | side by side (parent: d13a04d)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 28 Mar 2016 17:40:31 +0000 (19:40 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 28 Mar 2016 17:40:31 +0000 (19:40 +0200) |
src/collectd-tg.c | patch | blob | history |
diff --git a/src/collectd-tg.c b/src/collectd-tg.c
index 53fd3a17362287de70c2849dff0b207e5649d990..04989dcef649b597297ba532cdda01fbfa9a8966 100644 (file)
--- a/src/collectd-tg.c
+++ b/src/collectd-tg.c
lcc_value_list_t *vl;
int host_num;
- vl = malloc (sizeof (*vl));
+ vl = calloc (1, sizeof (*vl));
if (vl == NULL)
{
- fprintf (stderr, "malloc failed.\n");
+ fprintf (stderr, "calloc failed.\n");
return (NULL);
}
- memset (vl, 0, sizeof (*vl));
vl->values = calloc (/* nmemb = */ 1, sizeof (*vl->values));
if (vl->values == NULL)