projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.spec: fix rpmlint warning
[collectd.git]
/
src
/
target_replace.c
diff --git
a/src/target_replace.c
b/src/target_replace.c
index
2166746
..
545fa35
100644
(file)
--- a/
src/target_replace.c
+++ b/
src/target_replace.c
@@
-102,13
+102,12
@@
static int tr_config_add_action (tr_action_t **dest, /* {{{ */
return (-1);
}
return (-1);
}
- act =
malloc (
sizeof (*act));
+ act =
calloc (1,
sizeof (*act));
if (act == NULL)
{
if (act == NULL)
{
- ERROR ("tr_config_add_action:
m
alloc failed.");
+ ERROR ("tr_config_add_action:
c
alloc failed.");
return (-ENOMEM);
}
return (-ENOMEM);
}
- memset (act, 0, sizeof (*act));
act->replacement = NULL;
act->may_be_empty = may_be_empty;
act->replacement = NULL;
act->may_be_empty = may_be_empty;
@@
-244,13
+243,12
@@
static int tr_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
int status;
int i;
int status;
int i;
- data =
malloc (
sizeof (*data));
+ data =
calloc (1,
sizeof (*data));
if (data == NULL)
{
if (data == NULL)
{
- ERROR ("tr_create:
m
alloc failed.");
+ ERROR ("tr_create:
c
alloc failed.");
return (-ENOMEM);
}
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->host = NULL;
data->plugin = NULL;
data->host = NULL;
data->plugin = NULL;