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 committed Sep 26, 2023
1 parent 738fe10 commit f152211
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 f152211

Please sign in to comment.