diff --git a/plugins/filter_alter_size/alter_size.c b/plugins/filter_alter_size/alter_size.c index e4f5693ea2b..75e50052bf3 100644 --- a/plugins/filter_alter_size/alter_size.c +++ b/plugins/filter_alter_size/alter_size.c @@ -51,6 +51,8 @@ static int cb_alter_size_init(struct flb_filter_instance *ins, if (ctx->log_decoder == NULL) { flb_plg_error(ins, "could not initialize event decoder"); + flb_free(ctx); + return -1; } @@ -58,7 +60,9 @@ static int cb_alter_size_init(struct flb_filter_instance *ins, if (ctx->log_encoder == NULL) { flb_plg_error(ins, "could not initialize event encoder"); + flb_log_event_decoder_destroy(ctx->log_decoder); + flb_free(ctx); return -1; }