Skip to content

Commit 7636151

Browse files
authored
config_format: yaml: fix double-free from freeing state before cleanup on exit. (#10199)
remove calls to state_destroy on error when it will be cleaned up at the end of the function that parses the yaml configuration. Signed-off-by: Phillip Whelan <[email protected]>
1 parent e2cee6a commit 7636151

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/config_format/flb_cf_yaml.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,6 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
28492849
flb_error("[config] file '%s' is already included", cfg_file);
28502850
flb_sds_destroy(include_dir);
28512851
flb_sds_destroy(include_file);
2852-
state_destroy(state);
28532852
return -1;
28542853
}
28552854

@@ -2860,7 +2859,6 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
28602859
flb_errno();
28612860
flb_sds_destroy(include_dir);
28622861
flb_sds_destroy(include_file);
2863-
state_destroy(state);
28642862
return -1;
28652863
}
28662864

@@ -2872,7 +2870,6 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
28722870
fclose(fh);
28732871
flb_sds_destroy(include_dir);
28742872
flb_sds_destroy(include_file);
2875-
state_destroy(state);
28762873
return -1;
28772874
}
28782875
ctx->level++;

0 commit comments

Comments
 (0)