projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plugin.c: fix indentation of comment
[collectd.git]
/
src
/
daemon
/
plugin.c
diff --git
a/src/daemon/plugin.c
b/src/daemon/plugin.c
index
6c8b6b0
..
7e905f9
100644
(file)
--- a/
src/daemon/plugin.c
+++ b/
src/daemon/plugin.c
@@
-368,13
+368,12
@@
static int create_register_callback (llist_t **list, /* {{{ */
{
callback_func_t *cf;
{
callback_func_t *cf;
- cf =
malloc (
sizeof (*cf));
+ cf =
calloc (1,
sizeof (*cf));
if (cf == NULL)
{
if (cf == NULL)
{
- ERROR ("plugin: create_register_callback:
m
alloc failed.");
+ ERROR ("plugin: create_register_callback:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (cf, 0, sizeof (*cf));
cf->cf_callback = callback;
if (ud == NULL)
cf->cf_callback = callback;
if (ud == NULL)
@@
-1244,14
+1243,13
@@
int plugin_register_read (const char *name,
read_func_t *rf;
int status;
read_func_t *rf;
int status;
- rf =
malloc (
sizeof (*rf));
+ rf =
calloc (1,
sizeof (*rf));
if (rf == NULL)
{
if (rf == NULL)
{
- ERROR ("plugin_register_read:
m
alloc failed.");
+ ERROR ("plugin_register_read:
c
alloc failed.");
return (ENOMEM);
}
return (ENOMEM);
}
- memset (rf, 0, sizeof (read_func_t));
rf->rf_callback = (void *) callback;
rf->rf_udata.data = NULL;
rf->rf_udata.free_func = NULL;
rf->rf_callback = (void *) callback;
rf->rf_udata.data = NULL;
rf->rf_udata.free_func = NULL;
@@
-1278,14
+1276,13
@@
int plugin_register_complex_read (const char *group, const char *name,
read_func_t *rf;
int status;
read_func_t *rf;
int status;
- rf =
malloc (
sizeof (*rf));
+ rf =
calloc (1,
sizeof (*rf));
if (rf == NULL)
{
if (rf == NULL)
{
- ERROR ("plugin_register_complex_read:
m
alloc failed.");
+ ERROR ("plugin_register_complex_read:
c
alloc failed.");
return (ENOMEM);
}
return (ENOMEM);
}
- memset (rf, 0, sizeof (read_func_t));
rf->rf_callback = (void *) callback;
if (group != NULL)
sstrncpy (rf->rf_group, group, sizeof (rf->rf_group));
rf->rf_callback = (void *) callback;
if (group != NULL)
sstrncpy (rf->rf_group, group, sizeof (rf->rf_group));
@@
-2357,7
+2354,7
@@
int plugin_dispatch_multivalue (value_list_t const *template, /* {{{ */
assert (template->values_len == 1);
assert (template->values_len == 1);
- /* Calculate sum for Gauge to calculate percent if needed */
+
/* Calculate sum for Gauge to calculate percent if needed */
if (DS_TYPE_GAUGE == store_type) {
va_start (ap, store_type);
while (42)
if (DS_TYPE_GAUGE == store_type) {
va_start (ap, store_type);
while (42)
@@
-2578,13
+2575,12
@@
static int plugin_notification_meta_add (notification_t *n,
return (-1);
}
return (-1);
}
- meta =
malloc (
sizeof (*meta));
+ meta =
calloc (1,
sizeof (*meta));
if (meta == NULL)
{
if (meta == NULL)
{
- ERROR ("plugin_notification_meta_add:
m
alloc failed.");
+ ERROR ("plugin_notification_meta_add:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (meta, 0, sizeof (notification_meta_t));
sstrncpy (meta->name, name, sizeof (meta->name));
meta->type = type;
sstrncpy (meta->name, name, sizeof (meta->name));
meta->type = type;