Skip to content

Commit b95fa0a

Browse files
alecholmesedsiper
authored andcommitted
engine: Fix segfault in flb_config_init error case
1 parent 7941aea commit b95fa0a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/flb_config.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ struct flb_config *flb_config_init()
345345
mk_list_init(&config->cmetrics);
346346
mk_list_init(&config->cf_parsers_list);
347347

348+
/* Initialize multiline-parser list. We need this here, because from now
349+
* on we use flb_config_exit to cleanup the config, which requires
350+
* the config->multiline_parsers list to be initialized. */
351+
mk_list_init(&config->multiline_parsers);
352+
348353
/* Task map */
349354
ret = flb_config_task_map_resize(config, FLB_CONFIG_DEFAULT_TASK_MAP_SIZE);
350355

@@ -354,11 +359,6 @@ struct flb_config *flb_config_init()
354359
return NULL;
355360
}
356361

357-
/* Initialize multiline-parser list. We need this here, because from now
358-
* on we use flb_config_exit to cleanup the config, which requires
359-
* the config->multiline_parsers list to be initialized. */
360-
mk_list_init(&config->multiline_parsers);
361-
362362
/* Environment */
363363
config->env = flb_env_create();
364364
if (config->env == NULL) {

0 commit comments

Comments
 (0)