projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d13a04d
)
collectd-tg: malloc + memset -> calloc
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
53fd3a1
..
04989dc
100644
(file)
--- a/
src/collectd-tg.c
+++ b/
src/collectd-tg.c
@@
-156,13
+156,12
@@
static lcc_value_list_t *create_value_list (void) /* {{{ */
lcc_value_list_t *vl;
int host_num;
- vl =
malloc (
sizeof (*vl));
+ vl =
calloc (1,
sizeof (*vl));
if (vl == NULL)
{
- fprintf (stderr, "
m
alloc failed.\n");
+ fprintf (stderr, "
c
alloc failed.\n");
return (NULL);
}
- memset (vl, 0, sizeof (*vl));
vl->values = calloc (/* nmemb = */ 1, sizeof (*vl->values));
if (vl->values == NULL)