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 #1634 from BrandonArp/add_write_http_headers
[collectd.git]
/
src
/
match_value.c
diff --git
a/src/match_value.c
b/src/match_value.c
index
4d49984
..
64e1136
100644
(file)
--- a/
src/match_value.c
+++ b/
src/match_value.c
@@
-58,8
+58,8
@@
struct mv_match_s
*/
static void mv_free_match (mv_match_t *m) /* {{{ */
{
*/
static void mv_free_match (mv_match_t *m) /* {{{ */
{
-
in
t i;
-
+
size_
t i;
+
if (m == NULL)
return;
if (m == NULL)
return;
@@
-69,7
+69,7
@@
static void mv_free_match (mv_match_t *m) /* {{{ */
free(m->data_sources[i]);
free(m->data_sources);
}
free(m->data_sources[i]);
free(m->data_sources);
}
-
+
free (m);
} /* }}} void mv_free_match */
free (m);
} /* }}} void mv_free_match */
@@
-200,13
+200,12
@@
static int mv_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
int status;
int i;
int status;
int i;
- m =
(mv_match_t *) malloc (
sizeof (*m));
+ m =
calloc (1,
sizeof (*m));
if (m == NULL)
{
if (m == NULL)
{
- ERROR ("mv_create:
m
alloc failed.");
+ ERROR ("mv_create:
c
alloc failed.");
return (-ENOMEM);
}
return (-ENOMEM);
}
- memset (m, 0, sizeof (*m));
m->min = NAN;
m->max = NAN;
m->min = NAN;
m->max = NAN;
@@
-277,7
+276,7
@@
static int mv_match (const data_set_t *ds, const value_list_t *vl, /* {{{ */
mv_match_t *m;
gauge_t *values;
int status;
mv_match_t *m;
gauge_t *values;
int status;
-
in
t i;
+
size_
t i;
if ((user_data == NULL) || (*user_data == NULL))
return (-1);
if ((user_data == NULL) || (*user_data == NULL))
return (-1);