Skip to content

Commit 8023366

Browse files
committed
engine: Fix segfault in flb_config_init error case
Signed-off-by: Alec Holmes <[email protected]>
1 parent 30895be commit 8023366

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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) {

src/flb_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ int flb_lib_push(flb_ctx_t *ctx, int ffd, const void *data, size_t len)
803803
/* Emulate some data from the response */
804804
int flb_lib_response(flb_ctx_t *ctx, int ffd, int status, const void *data, size_t len)
805805
{
806-
int ret;
806+
int ret = 0;
807807
struct flb_output_instance *o_ins;
808808

809809
if (ctx->status == FLB_LIB_NONE || ctx->status == FLB_LIB_ERROR) {

0 commit comments

Comments
 (0)