projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: cleanup whitespace
[collectd.git]
/
src
/
memcachec.c
diff --git
a/src/memcachec.c
b/src/memcachec.c
index
93dbdbc
..
1e1d42d
100644
(file)
--- a/
src/memcachec.c
+++ b/
src/memcachec.c
@@
-206,13
+206,12
@@
static int cmc_config_add_match (web_page_t *page, /* {{{ */
WARNING ("memcachec plugin: Ignoring arguments for the `Match' block.");
}
WARNING ("memcachec plugin: Ignoring arguments for the `Match' block.");
}
- match =
(web_match_t *) malloc (
sizeof (*match));
+ match =
calloc (1,
sizeof (*match));
if (match == NULL)
{
if (match == NULL)
{
- ERROR ("memcachec plugin:
m
alloc failed.");
+ ERROR ("memcachec plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (match, 0, sizeof (*match));
status = 0;
for (i = 0; i < ci->children_num; i++)
status = 0;
for (i = 0; i < ci->children_num; i++)
@@
-263,7
+262,10
@@
static int cmc_config_add_match (web_page_t *page, /* {{{ */
} /* while (status == 0) */
if (status != 0)
} /* while (status == 0) */
if (status != 0)
+ {
+ cmc_web_match_free (match);
return (status);
return (status);
+ }
match->match = match_create_simple (match->regex, match->exclude_regex,
match->dstype);
match->match = match_create_simple (match->regex, match->exclude_regex,
match->dstype);
@@
-302,13
+304,12
@@
static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */
return (-1);
}
return (-1);
}
- page =
(web_page_t *) malloc (
sizeof (*page));
+ page =
calloc (1,
sizeof (*page));
if (page == NULL)
{
if (page == NULL)
{
- ERROR ("memcachec plugin:
m
alloc failed.");
+ ERROR ("memcachec plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (page, 0, sizeof (*page));
page->server = NULL;
page->key = NULL;
page->server = NULL;
page->key = NULL;
@@
-500,6
+501,7
@@
static int cmc_read_page (web_page_t *wp) /* {{{ */
}
cmc_submit (wp, wm, mv);
}
cmc_submit (wp, wm, mv);
+ match_value_reset (mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
sfree (wp->buffer);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
sfree (wp->buffer);