Skip to content

Commit

Permalink
filter_modifier: added missing log event encoder and decoder disposal
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <leonardo.alminana@chronosphere.io>
  • Loading branch information
leonardo-albertovich committed Mar 7, 2025
1 parent 144ed72 commit 46764d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/filter_record_modifier/filter_modifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,20 @@ static int cb_modifier_filter(const void *data, size_t bytes,
if (map_num > BOOL_MAP_LIMIT) {
flb_plg_error(ctx->ins, "The number of elements exceeds limit %d",
BOOL_MAP_LIMIT);

flb_log_event_decoder_destroy(&log_decoder);
flb_log_event_encoder_destroy(&log_encoder);

return -1;
}
/* allocate map_num + guard byte */
bool_map = flb_calloc(map_num+1, sizeof(bool_map_t));
if (bool_map == NULL) {
flb_errno();

flb_log_event_decoder_destroy(&log_decoder);
flb_log_event_encoder_destroy(&log_encoder);

return -1;
}
removed_map_num = make_bool_map(ctx, obj,
Expand Down

0 comments on commit 46764d5

Please sign in to comment.