Skip to content

Fix memory leak when decoding a property list with a virtual dataset layout #5694

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fortnern
Copy link
Member

@fortnern fortnern commented Jul 29, 2025

The code to decode a layout encoded on a serialized DCPL has been updated to properly build the source file and dataset name hash tables, and set the "orig" fields properly so the name buffers are freed if they're not shared. This should fix the memory leaks that occurred because the orig fields were not set, as well as avoid a potential bug if a duplicate source file or dataset were added after decoding.

Addresses #5695


Important

Fix memory leak in H5P__dcrt_layout_dec() by setting "orig" fields and building hash tables for source file and dataset names.

  • Memory Management:
    • Fix memory leak in H5P__dcrt_layout_dec() by properly setting "orig" fields for source file and dataset names.
    • Ensure name buffers are freed if not shared, preventing memory leaks.
  • Hash Tables:
    • Build hash tables for source file and dataset names in H5P__dcrt_layout_dec() to avoid duplicate entries.
    • Use HASH_FIND and HASH_ADD_KEYPTR to manage entries efficiently.

This description was created by Ellipsis for e870406. You can customize this summary. It will automatically update as commits are pushed.

@byrnHDF
Copy link
Contributor

byrnHDF commented Jul 31, 2025

This change can be tested by executing the dailybuild on this branch in your fork (change check to ignore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To be triaged
Development

Successfully merging this pull request may close these issues.

3 participants