Skip to content

Commit 1ca1d02

Browse files
DavidKorczynskileonardo-albertovich
authored andcommitted
config_format: adjust leak fix
Signed-off-by: David Korczynski <[email protected]>
1 parent e7e102a commit 1ca1d02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/config_format/flb_cf_yaml.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,12 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
20412041
yaml_parser_delete(&parser);
20422042

20432043
/* free all remaining states */
2044-
while (state = state_pop(ctx));
2044+
if (code == -1) {
2045+
while (state = state_pop(ctx));
2046+
}
2047+
else {
2048+
state = state_pop(ctx);
2049+
}
20452050

20462051
fclose(fh);
20472052
ctx->level--;

0 commit comments

Comments
 (0)