Skip to content

Commit

Permalink
filter_alter_size: fixed memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: leonardo-albertovich <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Sep 2, 2024
1 parent 72a8188 commit c6e902a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/filter_alter_size/alter_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ 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;
}

ctx->log_encoder = flb_log_event_encoder_create(FLB_LOG_EVENT_FORMAT_DEFAULT);

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;
}
Expand Down

0 comments on commit c6e902a

Please sign in to comment.