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

Clean up memory allocated when reading messages in H5Dlayout on error (#2602) #2687

Merged
merged 8 commits into from
Apr 11, 2023

Conversation

glennsong09
Copy link
Contributor

No description provided.

src/H5Dlayout.c Outdated
hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */
herr_t ret_value = SUCCEED; /* Return value */
htri_t msg_exists; /* Whether a particular type of message exists */
hbool_t dcpl_cache_pline_copied = FALSE; /* Flag to indicate that dcpl_cache.pline's message was copied */
Copy link
Member

Choose a reason for hiding this comment

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

It's a small thing, but I would make the naming scheme consistent, probably by dropping the dcpl_cache from the name of this identifier.

Copy link
Member

@derobins derobins left a comment

Choose a reason for hiding this comment

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

I would consider making the small change I requested, but otherwise this looks good.

@glennsong09
Copy link
Contributor Author

I will make the change.

@jhendersonHDF
Copy link
Collaborator

Also, please add an entry in release_docs/RELEASE.txt with a short description of the issue and fix. Otherwise this looks good to me.

@derobins
Copy link
Member

Also, please add an entry in release_docs/RELEASE.txt with a short description of the issue and fix. Otherwise this looks good to me.

Oh yeah, forgot to emphasize that. Should definitely do that.

@@ -151,6 +151,12 @@ Bug Fixes since HDF5-1.13.3 release
===================================
Library
-------
- Fixed memory leaks that could occur when reading a dataset from a malformed file

When attempting to read layout, pline, and efl information for a dataset, memory leaks could occur if attempting to read pline/efl information threw an error, which is due to the memory that was allocated for pline and efl not being properly cleaned up on error.
Copy link
Member

Choose a reason for hiding this comment

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

This should wrap on 75-ish characters

@jhendersonHDF jhendersonHDF added Merge - To 1.14 This needs to be merged to HDF5 1.14 Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C Library Core C library issues (usually in the src directory) Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub labels Apr 20, 2023
@glennsong09 glennsong09 deleted the layout_fix branch May 11, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Merge - To 1.14 This needs to be merged to HDF5 1.14 Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Projects
Status: Merge to 1.12
Development

Successfully merging this pull request may close these issues.

4 participants