X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmemcachec.c;h=a23d4956e1e978b0910ab1ef05e8a4ed5b930de4;hb=1ebf2f31bd2e080e6f42de640f0a3899a61501c0;hp=37f189468b51e7459fd1f189c22cc920d95c06cd;hpb=b57d6e25aa792f0461aee4e5bd6d1838c478af50;p=collectd.git diff --git a/src/memcachec.c b/src/memcachec.c index 37f18946..a23d4956 100644 --- a/src/memcachec.c +++ b/src/memcachec.c @@ -206,7 +206,7 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ WARNING ("memcachec plugin: Ignoring arguments for the `Match' block."); } - match = (web_match_t *) malloc (sizeof (*match)); + match = malloc (sizeof (*match)); if (match == NULL) { ERROR ("memcachec plugin: malloc failed."); @@ -263,7 +263,10 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ } /* while (status == 0) */ if (status != 0) + { + cmc_web_match_free (match); return (status); + } match->match = match_create_simple (match->regex, match->exclude_regex, match->dstype); @@ -302,7 +305,7 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */ return (-1); } - page = (web_page_t *) malloc (sizeof (*page)); + page = malloc (sizeof (*page)); if (page == NULL) { ERROR ("memcachec plugin: malloc failed.");