projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1743 from rubenk/apcups-coverity
[collectd.git]
/
src
/
match_empty_counter.c
diff --git
a/src/match_empty_counter.c
b/src/match_empty_counter.c
index
abde2b3
..
8f99a6d
100644
(file)
--- a/
src/match_empty_counter.c
+++ b/
src/match_empty_counter.c
@@
-46,13
+46,12
@@
static int mec_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
{
mec_match_t *m;
{
mec_match_t *m;
- m =
(mec_match_t *) malloc (
sizeof (*m));
+ m =
calloc (1,
sizeof (*m));
if (m == NULL)
{
if (m == NULL)
{
- ERROR ("mec_create:
m
alloc failed.");
+ ERROR ("mec_create:
c
alloc failed.");
return (-ENOMEM);
}
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
if (ci->children_num != 0)
{
if (ci->children_num != 0)
{
@@
-80,7
+79,7
@@
static int mec_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */
{
int num_counters;
int num_empty;
{
int num_counters;
int num_empty;
-
in
t i;
+
size_
t i;
if ((user_data == NULL) || (*user_data == NULL))
return (-1);
if ((user_data == NULL) || (*user_data == NULL))
return (-1);