amazon-ion / ion-c

A C implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
166 stars 43 forks source link

Fix leak of reader during path extraction #305

Closed nirosys closed 2 years ago

nirosys commented 2 years ago

Issue #, if available: None

Description of changes: During the execution of ion_extractor_path_create_from_ion, a reader is created that does not get freed.

I added the freeing of the reader, but also removed the use of iRETURN and manually defined the fail label, so that I could ensure all paths lead to the reader being closed.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.