Skip to content

Commit

Permalink
config_format: fix memory leak
Browse files Browse the repository at this point in the history
There can be multiple states needing to be popped in the event of
errors.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61733

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and leonardo-albertovich committed Sep 26, 2023
1 parent 4dd7d6d commit e7e102a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config_format/flb_cf_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,9 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
}

yaml_parser_delete(&parser);
state_pop(ctx);

/* free all remaining states */
while (state = state_pop(ctx));

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

0 comments on commit e7e102a

Please sign in to comment.