diff options
Diffstat (limited to 'ext/psych/yaml/parser.c')
-rw-r--r-- | ext/psych/yaml/parser.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c index 621f676bf2..ec2f8d3e05 100644 --- a/ext/psych/yaml/parser.c +++ b/ext/psych/yaml/parser.c @@ -1261,7 +1261,10 @@ yaml_parser_process_directives(yaml_parser_t *parser, goto error; } if (token->data.version_directive.major != 1 - || token->data.version_directive.minor != 1) { + || ( + token->data.version_directive.minor != 1 + && token->data.version_directive.minor != 2 + )) { yaml_parser_set_parser_error(parser, "found incompatible YAML document", token->start_mark); goto error; @@ -1316,6 +1319,8 @@ yaml_parser_process_directives(yaml_parser_t *parser, STACK_DEL(parser, tag_directives); } + if (!version_directive_ref) + yaml_free(version_directive); return 1; error: |