projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0f3e34
)
write_tsdb plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:44:47 +0000
(18:44 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:44:47 +0000
(18:44 +0200)
src/write_tsdb.c
patch
|
blob
|
history
diff --git
a/src/write_tsdb.c
b/src/write_tsdb.c
index
c562596
..
0fa6245
100644
(file)
--- a/
src/write_tsdb.c
+++ b/
src/write_tsdb.c
@@
-579,13
+579,12
@@
static int wt_config_tsd(oconfig_item_t *ci)
char callback_name[DATA_MAX_NAME_LEN];
int i;
- cb =
malloc(
sizeof(*cb));
+ cb =
calloc(1,
sizeof(*cb));
if (cb == NULL)
{
- ERROR("write_tsdb plugin:
m
alloc failed.");
+ ERROR("write_tsdb plugin:
c
alloc failed.");
return -1;
}
- memset(cb, 0, sizeof(*cb));
cb->sock_fd = -1;
cb->node = NULL;
cb->service = NULL;