Fix memory leak when decoding a property list with a virtual dataset layout #5694
+52
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.H5P__dcrt_layout_dec()
by properly setting "orig" fields for source file and dataset names.H5P__dcrt_layout_dec()
to avoid duplicate entries.HASH_FIND
andHASH_ADD_KEYPTR
to manage entries efficiently.This description was created by
for e870406. You can customize this summary. It will automatically update as commits are pushed.