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 memory bug in selection I/O #2096

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Fix memory bug in selection I/O #2096

merged 2 commits into from
Sep 14, 2022

Conversation

fortnern
Copy link
Member

H5FD_read/write_selection() is passed an array of H5S_t *s and in some cases needs to create to pass an array of hid_ts referencing these H5S_t *s to the underlying callback. The function does this using H5I_register(). When freeing memory at the end of the function, it would previously call H5I_dec_app_ref on the ids, which had the side effect of freeing the H5S_t *s, even though they were not created by H5FD_read/write_selection(), causing problems when the calling function(s) tried to use these spaces afterwards. Changed to H5I_remove().

src/H5FDint.c Outdated Show resolved Hide resolved
Copy link
Contributor

@bmribler bmribler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lrknox lrknox merged commit b559857 into HDFGroup:develop Sep 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.

5 participants