filter_parser: fix leak on exit
@@ -345,10 +345,13 @@ static int cb_parser_exit(void *data, struct flb_config *config)
{
struct filter_parser_ctx *ctx = data;
- if (ctx != NULL) {
+ if (!ctx) {
+ return 0;
+ }
+
delete_parsers(ctx);
+ flb_free(ctx->key_name);
flb_free(ctx);
- }
return 0;
}
