yaml / libyaml

Canonical source repository for LibYAML
http://pyyaml.org/wiki/LibYAML
MIT License
921 stars 312 forks source link

Return early in yaml_emitter_close #292

Open perlpunk opened 2 months ago

perlpunk commented 2 months ago

If yaml_emitter_dump failed, the emitter might be in a broken state and have leftover states/events. yaml_emitter_close calls yaml_emitter_emit which will try to emit those events, so we should return early.

The recommended thing to do for library users is to abort when yaml_emitter_dump fails, but it's easy to add a check here as well.

perlpunk commented 2 months ago

CI failure addressed by #293