summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 911f433)
raw | patch | inline | side by side (parent: 911f433)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:22:52 +0000 (18:22 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:22:52 +0000 (18:22 +0200) |
src/target_notification.c | patch | blob | history | |
src/target_replace.c | patch | blob | history | |
src/target_scale.c | patch | blob | history | |
src/target_set.c | patch | blob | history |
index d850a684907c0b9c960d8c432f2465110bced39b..55b72ac1acf330f15ea8899aa8181ca134a64bd3 100644 (file)
int status;
int i;
- data = malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("tn_create: malloc failed.");
+ ERROR ("tn_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->message = NULL;
data->severity = 0;
diff --git a/src/target_replace.c b/src/target_replace.c
index 2166746c1246e99657739856994edc8286fbd083..545fa3530f960a61c26be2012cbebd8fcc0d4290 100644 (file)
--- a/src/target_replace.c
+++ b/src/target_replace.c
return (-1);
}
- act = malloc (sizeof (*act));
+ act = calloc (1, sizeof (*act));
if (act == NULL)
{
- ERROR ("tr_config_add_action: malloc failed.");
+ ERROR ("tr_config_add_action: calloc failed.");
return (-ENOMEM);
}
- memset (act, 0, sizeof (*act));
act->replacement = NULL;
act->may_be_empty = may_be_empty;
int status;
int i;
- data = malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("tr_create: malloc failed.");
+ ERROR ("tr_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->host = NULL;
data->plugin = NULL;
diff --git a/src/target_scale.c b/src/target_scale.c
index b667ed13ed618ae243b0084ca6778452c42253a8..3ac399c904bcbafff2a803dc06bb6ee015d0485c 100644 (file)
--- a/src/target_scale.c
+++ b/src/target_scale.c
int status;
int i;
- data = malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("ts_create: malloc failed.");
+ ERROR ("ts_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->factor = NAN;
data->offset = NAN;
diff --git a/src/target_set.c b/src/target_set.c
index a676a3d1326eb06c87f9c46ea334f733a3838939..faad0bf54e35b7d57b2366e60907fdd4cebe7ce6 100644 (file)
--- a/src/target_set.c
+++ b/src/target_set.c
int status;
int i;
- data = malloc (sizeof (*data));
+ data = calloc (1, sizeof (*data));
if (data == NULL)
{
- ERROR ("ts_create: malloc failed.");
+ ERROR ("ts_create: calloc failed.");
return (-ENOMEM);
}
- memset (data, 0, sizeof (*data));
data->host = NULL;
data->plugin = NULL;