diff --git a/lib/filterx/filterx-grammar.ym b/lib/filterx/filterx-grammar.ym index c8bdf169a5..1d4da691e2 100644 --- a/lib/filterx/filterx-grammar.ym +++ b/lib/filterx/filterx-grammar.ym @@ -309,6 +309,7 @@ generator_casted_assignment NULL ); free($3); + free($5); } | expr '[' expr ']' KW_ASSIGN func_name '(' expr_generator ')' { @@ -355,7 +356,7 @@ declaration filterx_generator_set_fillable($4, filterx_expr_ref($2)); $$ = filterx_compound_expr_new_va(TRUE, - filterx_assign_new($2, filterx_generator_create_container_new($4, json_func)), + filterx_assign_new($2, filterx_generator_create_container_new(filterx_expr_ref($4), json_func)), $4, NULL ); diff --git a/lib/logsource.c b/lib/logsource.c index 06586d5fbd..fa3d2c5df7 100644 --- a/lib/logsource.c +++ b/lib/logsource.c @@ -727,6 +727,8 @@ _set_metric_options(LogSource *self, const gchar *stats_id, StatsClusterKeyBuild self->stats_id, instance_name); stats_cluster_key_builder_set_legacy_alias_name(self->metrics.stats_kb, "processed"); stats_cluster_key_builder_add_label(self->metrics.stats_kb, stats_cluster_label("id", self->stats_id)); + if (self->metrics.recvd_messages_key) + stats_cluster_key_free(self->metrics.recvd_messages_key); self->metrics.recvd_messages_key = stats_cluster_key_builder_build_single(self->metrics.stats_kb); } stats_cluster_key_builder_pop(self->metrics.stats_kb); @@ -735,6 +737,8 @@ _set_metric_options(LogSource *self, const gchar *stats_id, StatsClusterKeyBuild { stats_cluster_key_builder_set_name(self->metrics.stats_kb, "input_event_bytes_total");; stats_cluster_key_builder_add_label(self->metrics.stats_kb, stats_cluster_label("id", self->stats_id)); + if (self->metrics.recvd_bytes_key) + stats_cluster_key_free(self->metrics.recvd_bytes_key); self->metrics.recvd_bytes_key = stats_cluster_key_builder_build_single(self->metrics.stats_kb); } stats_cluster_key_builder_pop(self->metrics.stats_kb); diff --git a/lib/logthrdest/logthrdestdrv.c b/lib/logthrdest/logthrdestdrv.c index 09075de99c..1343584228 100644 --- a/lib/logthrdest/logthrdestdrv.c +++ b/lib/logthrdest/logthrdestdrv.c @@ -1324,6 +1324,15 @@ _unregister_driver_stats(LogThreadedDestDriver *self) stats_cluster_key_free(self->metrics.processed_sc_key); self->metrics.processed_sc_key = NULL; } + + if (self->metrics.output_event_retries_sc_key) + { + stats_unregister_counter(self->metrics.output_event_retries_sc_key, SC_TYPE_SINGLE_VALUE, + &self->metrics.output_event_retries); + + stats_cluster_key_free(self->metrics.output_event_retries_sc_key); + self->metrics.output_event_retries_sc_key = NULL; + } } stats_unlock(); } diff --git a/lib/metrics/dyn-metrics-template.c b/lib/metrics/dyn-metrics-template.c index 9c8bdaf586..aaf031b38b 100644 --- a/lib/metrics/dyn-metrics-template.c +++ b/lib/metrics/dyn-metrics-template.c @@ -164,6 +164,7 @@ dyn_metrics_template_clone(DynMetricsTemplate *self, GlobalConfig *cfg) LabelTemplate *label_template = (LabelTemplate *) elem->data; cloned->label_templates = g_list_append(cloned->label_templates, label_template_clone(label_template)); } + value_pairs_unref(cloned->vp); cloned->vp = value_pairs_ref(self->vp); return cloned; } diff --git a/lib/pragma-grammar.ym b/lib/pragma-grammar.ym index a13cee2bd7..39faeef23d 100644 --- a/lib/pragma-grammar.ym +++ b/lib/pragma-grammar.ym @@ -190,6 +190,7 @@ requires_stmt evt_tag_str("details", $3 ? : "none"), cfg_lexer_format_location_tag(lexer,&@1)); free($2); + free($3); PRAGMA_ERROR(); } else @@ -201,6 +202,7 @@ requires_stmt } } free($2); + free($3); } ; diff --git a/modules/appmodel/transformation.c b/modules/appmodel/transformation.c index 2f6cc0c5cd..d11119f776 100644 --- a/modules/appmodel/transformation.c +++ b/modules/appmodel/transformation.c @@ -38,6 +38,7 @@ transformation_step_free(TransformationStep *self) { g_free(self->name); g_free(self->expr); + g_free(self); } /* TransformationBlock: named list of steps */ diff --git a/modules/metrics-probe/metrics-probe.c b/modules/metrics-probe/metrics-probe.c index 7ad6f56662..9239de334f 100644 --- a/modules/metrics-probe/metrics-probe.c +++ b/modules/metrics-probe/metrics-probe.c @@ -157,6 +157,7 @@ _clone(LogPipe *s) MetricsProbe *cloned = (MetricsProbe *) metrics_probe_new(s->cfg); log_parser_clone_settings(&self->super, &cloned->super); + dyn_metrics_template_free(cloned->metrics_template); cloned->metrics_template = dyn_metrics_template_clone(self->metrics_template, s->cfg); metrics_probe_set_increment_template(&cloned->super, self->increment_template); diff --git a/modules/python-modules/syslogng/debuggercli/tests/test_langcompleter.py b/modules/python-modules/syslogng/debuggercli/tests/test_langcompleter.py index 50e9428992..1369b69bfd 100644 --- a/modules/python-modules/syslogng/debuggercli/tests/test_langcompleter.py +++ b/modules/python-modules/syslogng/debuggercli/tests/test_langcompleter.py @@ -57,7 +57,7 @@ class TestLangCompleter(CompleterTestCase): 'PARTIAL_TOKEN': ChoiceCompleter(("tokenP-a", "tokenP-b"), prefix='@', suffix='') } - # pylint: disable=arguments-differ,too-many-arguments + # pylint: disable=arguments-differ,too-many-arguments,too-many-positional-arguments def _construct_completer(self, expected_token=None, expected_tokens=None, replaced_token=None, replaced_token_pos=-1, completers=None, prefix="