Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple leaks around event and symbol cleanup #304

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

nirosys
Copy link
Contributor

@nirosys nirosys commented Jul 9, 2022

Issue #, if available: None

Description of changes:
This PR addresses two instances in ion_event_stream where leaks were occurring.

The first is when cleaning up the annotation symbols, and field name, at the end of ion_event_stream_read_event. The string data for value_field_name, as well as each of the symbols stored in value_annotations was not freed.

The second was when removing an event from the event stream in ion_event_stream_is_event_stream. Once the pointer to the event is removed from the vector, the object itself needed to be freed.


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

Prior to this commit, ion_event_stream_read_event did not completely
clean up the internal string data for annotation symbols (name and
import_location) and the current p_value_field_name.
@cheqianh
Copy link
Contributor

cheqianh commented Jul 11, 2022

test-driver failed due to different line number,
ion_event_stream.cpp:1063 : IERR_INVALID_SYMBOL vs. ion_event_stream.cpp:1076 : IERR_INVALID_SYMBOL
which is expected (in other words, the PR is correct).

@nirosys nirosys marked this pull request as ready for review July 11, 2022 20:30
@nirosys nirosys merged commit bfc420a into amazon-ion:master Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants