Skip to content

Commit e7e102a

Browse files
DavidKorczynskileonardo-albertovich
authored andcommitted
config_format: fix memory leak
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]>
1 parent 4dd7d6d commit e7e102a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/config_format/flb_cf_yaml.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,9 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
20392039
}
20402040

20412041
yaml_parser_delete(&parser);
2042-
state_pop(ctx);
2042+
2043+
/* free all remaining states */
2044+
while (state = state_pop(ctx));
20432045

20442046
fclose(fh);
20452047
ctx->level--;

0 commit comments

Comments
 (0)