summaryrefslogtreecommitdiffstats
path: root/parser
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-05-07 23:00:44 +0300
committerGitHub <noreply@github.com>2022-05-07 23:00:44 +0300
commit79444d36459b105f093c5626eea8f0b45af7f421 (patch)
treeb260e2268c3ec6deff4abf32aff9ef20b85a2ce8 /parser
parent0cbf49860b14a04a618345f7029cd2000e651f89 (diff)
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
Diffstat (limited to 'parser')
-rw-r--r--parser/parser.c12
1 files changed, 1 insertions, 11 deletions
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;
}