projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.conf(5): Document the gRPC plugin.
[collectd.git]
/
src
/
target_scale.c
diff --git
a/src/target_scale.c
b/src/target_scale.c
index
6169fa0
..
74652ff
100644
(file)
--- a/
src/target_scale.c
+++ b/
src/target_scale.c
@@
-328,7
+328,7
@@
static int ts_config_add_data_source(ts_data_t *data, /* {{{ */
/* Allocate space for the char pointers */
new_data_sources_num = data->data_sources_num + ((size_t) ci->values_num);
/* Allocate space for the char pointers */
new_data_sources_num = data->data_sources_num + ((size_t) ci->values_num);
- temp =
(char **)
realloc (data->data_sources,
+ temp = realloc (data->data_sources,
new_data_sources_num * sizeof (char *));
if (temp == NULL)
{
new_data_sources_num * sizeof (char *));
if (temp == NULL)
{
@@
-387,13
+387,12
@@
static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
int status;
int i;
int status;
int i;
- data =
(ts_data_t *) malloc (
sizeof (*data));
+ data =
calloc (1,
sizeof (*data));
if (data == NULL)
{
if (data == NULL)
{
- ERROR ("ts_create:
m
alloc failed.");
+ ERROR ("ts_create:
c
alloc failed.");
return (-ENOMEM);
}
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->factor = NAN;
data->offset = NAN;
data->factor = NAN;
data->offset = NAN;