Skip to content

Commit c6e902a

Browse files
leonardo-albertovichedsiper
authored andcommitted
filter_alter_size: fixed memory leak
Signed-off-by: leonardo-albertovich <[email protected]>
1 parent 72a8188 commit c6e902a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugins/filter_alter_size/alter_size.c

+4
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ static int cb_alter_size_init(struct flb_filter_instance *ins,
5151
if (ctx->log_decoder == NULL) {
5252
flb_plg_error(ins, "could not initialize event decoder");
5353

54+
flb_free(ctx);
55+
5456
return -1;
5557
}
5658

5759
ctx->log_encoder = flb_log_event_encoder_create(FLB_LOG_EVENT_FORMAT_DEFAULT);
5860

5961
if (ctx->log_encoder == NULL) {
6062
flb_plg_error(ins, "could not initialize event encoder");
63+
6164
flb_log_event_decoder_destroy(ctx->log_decoder);
65+
flb_free(ctx);
6266

6367
return -1;
6468
}

0 commit comments

Comments
 (0)