Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter_alter_size: fixed memory leak (CID 508216) #9316

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading