projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e6efef
)
pinba plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:04:51 +0000
(18:04 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:04:51 +0000
(18:04 +0200)
src/pinba.c
patch
|
blob
|
history
diff --git
a/src/pinba.c
b/src/pinba.c
index
d13d047
..
f6ddcda
100644
(file)
--- a/
src/pinba.c
+++ b/
src/pinba.c
@@
-381,14
+381,13
@@
static pinba_socket_t *pinba_socket_open (const char *node, /* {{{ */
}
assert (ai_list != NULL);
- s =
malloc (
sizeof (*s));
+ s =
calloc (1,
sizeof (*s));
if (s == NULL)
{
freeaddrinfo (ai_list);
- ERROR ("pinba plugin:
m
alloc failed.");
+ ERROR ("pinba plugin:
c
alloc failed.");
return (NULL);
}
- memset (s, 0, sizeof (*s));
for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
{