Skip to content

Commit

Permalink
in_tail: initialize mult_parsers list before parsing properties
Browse files Browse the repository at this point in the history
if not initialized, any error during the parsing of options will cause
the *mult_destroy function to segfault.

Signed-off-by: Jorge Niedbalski <[email protected]>
  • Loading branch information
niedbalski committed Apr 20, 2021
1 parent d658924 commit cae08d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/in_tail/tail_multiline.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ int flb_tail_mult_create(struct flb_tail_config *ctx,
ctx->multiline_flush = 1;
}

mk_list_init(&ctx->mult_parsers);

/* Get firstline parser */
tmp = flb_input_get_property("parser_firstline", ins);
if (!tmp) {
Expand All @@ -70,7 +72,6 @@ int flb_tail_mult_create(struct flb_tail_config *ctx,
}

ctx->mult_parser_firstline = parser;
mk_list_init(&ctx->mult_parsers);

/* Read all multiline rules */
mk_list_foreach(head, &ins->properties) {
Expand Down

0 comments on commit cae08d2

Please sign in to comment.