projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1634 from BrandonArp/add_write_http_headers
[collectd.git]
/
src
/
write_http.c
diff --git
a/src/write_http.c
b/src/write_http.c
index
2733781
..
9a40511
100644
(file)
--- a/
src/write_http.c
+++ b/
src/write_http.c
@@
-182,7
+182,7
@@
static int wh_callback_init (wh_callback_t *cb) /* {{{ */
if (cb->pass != NULL)
credentials_size += strlen (cb->pass);
if (cb->pass != NULL)
credentials_size += strlen (cb->pass);
- cb->credentials =
(char *)
malloc (credentials_size);
+ cb->credentials = malloc (credentials_size);
if (cb->credentials == NULL)
{
ERROR ("curl plugin: malloc failed.");
if (cb->credentials == NULL)
{
ERROR ("curl plugin: malloc failed.");
@@
-567,13
+567,12
@@
static int wh_config_node (oconfig_item_t *ci) /* {{{ */
int status = 0;
int i;
int status = 0;
int i;
- cb =
malloc (
sizeof (*cb));
+ cb =
calloc (1,
sizeof (*cb));
if (cb == NULL)
{
if (cb == NULL)
{
- ERROR ("write_http plugin:
m
alloc failed.");
+ ERROR ("write_http plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (cb, 0, sizeof (*cb));
cb->verify_peer = 1;
cb->verify_host = 1;
cb->format = WH_FORMAT_COMMAND;
cb->verify_peer = 1;
cb->verify_host = 1;
cb->format = WH_FORMAT_COMMAND;