Skip to content

Commit

Permalink
config_format: adjust leak fix
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and leonardo-albertovich committed Sep 26, 2023
1 parent e7e102a commit 1ca1d02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config_format/flb_cf_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,12 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
yaml_parser_delete(&parser);

/* free all remaining states */
while (state = state_pop(ctx));
if (code == -1) {
while (state = state_pop(ctx));
}
else {
state = state_pop(ctx);
}

fclose(fh);
ctx->level--;
Expand Down

0 comments on commit 1ca1d02

Please sign in to comment.