From 79444d36459b105f093c5626eea8f0b45af7f421 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Sat, 7 May 2022 23:00:44 +0300 Subject: fix memory leaks and mismatches of the use of the z functions for allocations (#12841) * fix mismatches of the use of the z functions for allocations * when there was no memory; the original name of the dimensions was freed, and with mismatching deallocator.. * fixed memory leak at rrdeng_load_metric_*() functions * fixed memory leak on exit of plugins.d parser * fixed memory leak on plugins and streaming receiver threads exit * fixed compiler warnings --- parser/parser.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'parser') diff --git a/parser/parser.c b/parser/parser.c index 5fc601cea0..5137cb61cf 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -33,20 +33,12 @@ PARSER *parser_init(RRDHOST *host, void *user, void *input, PARSER_INPUT_TYPE fl PARSER *parser; parser = callocz(1, sizeof(*parser)); - - if (unlikely(!parser)) - return NULL; - parser->plugins_action = callocz(1, sizeof(PLUGINSD_ACTION)); - if (unlikely(!parser->plugins_action)) { - freez(parser); - return NULL; - } - parser->user = user; parser->input = input; parser->flags = flags; parser->host = host; + #ifdef ENABLE_HTTPS parser->bytesleft = 0; parser->readfrom = NULL; @@ -181,9 +173,7 @@ void parser_destroy(PARSER *parser) } freez(parser->plugins_action); - freez(parser); - return; } -- cgit v1.2.3