Skip to content

Commit

Permalink
in_event_type: fixed two leaks
Browse files Browse the repository at this point in the history
Signed-off-by: leonardo-albertovich <leonardo.alminana@chronosphere.io>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Sep 1, 2024
1 parent fe43ed1 commit 851d94b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/in_event_type/event_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,13 @@ static int cb_event_type_init(struct flb_input_instance *ins,

ret = flb_input_config_map_set(ins, (void *) ctx);
if (ret == -1) {
flb_free(ctx);

return -1;
}

flb_input_set_context(ins, ctx);


ctx->type = FLB_EVENT_TYPE_LOGS;
tmp = (char *) flb_input_get_property("type", ins);
if (tmp) {
Expand All @@ -431,8 +432,11 @@ static int cb_event_type_init(struct flb_input_instance *ins,
ret = flb_input_set_collector_time(ins, cb_collector_time,
ctx->interval_sec, ctx->interval_nsec, config);
if (ret < 0) {
flb_free(ctx);

return -1;
}

ctx->coll_fd = ret;

return 0;
Expand Down

0 comments on commit 851d94b

Please sign in to comment.