projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
722969f
)
write_http plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:36:46 +0000
(18:36 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:36:46 +0000
(18:36 +0200)
src/write_http.c
patch
|
blob
|
history
diff --git
a/src/write_http.c
b/src/write_http.c
index
ec3a01c
..
14ce0ec
100644
(file)
--- a/
src/write_http.c
+++ b/
src/write_http.c
@@
-549,13
+549,12
@@
static int wh_config_node (oconfig_item_t *ci) /* {{{ */
int status = 0;
int i;
- cb =
malloc (
sizeof (*cb));
+ cb =
calloc (1,
sizeof (*cb));
if (cb == NULL)
{
- ERROR ("write_http plugin:
m
alloc failed.");
+ ERROR ("write_http plugin:
c
alloc failed.");
return (-1);
}
- memset (cb, 0, sizeof (*cb));
cb->verify_peer = 1;
cb->verify_host = 1;
cb->format = WH_FORMAT_COMMAND;