summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7383e7c)
raw | patch | inline | side by side (parent: 7383e7c)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:09:12 +0000 (17:09 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:09:12 +0000 (17:09 +0200) |
index 4a5dc8c06680180b75de83fcf2248e92b52d80c7..8f99a6d163cc0c4547fa516d30816e8d50181bc7 100644 (file)
{
mec_match_t *m;
- m = malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- ERROR ("mec_create: malloc failed.");
+ ERROR ("mec_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
if (ci->children_num != 0)
{
diff --git a/src/match_hashed.c b/src/match_hashed.c
index 049dd28d830b60ec6fb00ed54de011ce5515a9f6..4178d75764e94d9dca4f2b81213dbe6c4b39d60b 100644 (file)
--- a/src/match_hashed.c
+++ b/src/match_hashed.c
mh_match_t *m;
int i;
- m = malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- ERROR ("mh_create: malloc failed.");
+ ERROR ("mh_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
for (i = 0; i < ci->children_num; i++)
{
diff --git a/src/match_regex.c b/src/match_regex.c
index 7429ffaf719d063e87367aaf2be42afafaf13d24..6e6bda2a41792cfa532561ad15ff858d86a37112 100644 (file)
--- a/src/match_regex.c
+++ b/src/match_regex.c
return (-1);
}
- re = malloc (sizeof (*re));
+ re = calloc (1, sizeof (*re));
if (re == NULL)
{
- log_err ("mr_config_add_regex: malloc failed.");
+ log_err ("mr_config_add_regex: calloc failed.");
return (-1);
}
- memset (re, 0, sizeof (*re));
re->next = NULL;
re->re_str = strdup (ci->values[0].value.string);
int status;
int i;
- m = malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- log_err ("mr_create: malloc failed.");
+ log_err ("mr_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
-
+
m->invert = 0;
status = 0;
diff --git a/src/match_timediff.c b/src/match_timediff.c
index 2b5f530a73620f1713e559662e98be23e1a35627..77c8f51966f3e19d7f93ee25efc5a21fe0d13afa 100644 (file)
--- a/src/match_timediff.c
+++ b/src/match_timediff.c
int status;
int i;
- m = malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- ERROR ("mt_create: malloc failed.");
+ ERROR ("mt_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
m->future = 0;
m->past = 0;
diff --git a/src/match_value.c b/src/match_value.c
index 9b13aa86155ac3051fdc2de8f58a78c4e81f743c..8c6fd36c9456581577270695992a46a772001f4b 100644 (file)
--- a/src/match_value.c
+++ b/src/match_value.c
int status;
int i;
- m = malloc (sizeof (*m));
+ m = calloc (1, sizeof (*m));
if (m == NULL)
{
- ERROR ("mv_create: malloc failed.");
+ ERROR ("mv_create: calloc failed.");
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
m->min = NAN;
m->max = NAN;