libyaml icon indicating copy to clipboard operation
libyaml copied to clipboard

Return early in yaml_emitter_close

Open perlpunk opened this issue 9 months ago • 1 comments

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 avatar Apr 28 '24 15:04 perlpunk