2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-24 17:51:25 +08:00

[svn-r18372] Fix for bug - I added the call to H5O_msg_reset after H5D_chunk_bh_info to free the

PLINE structure in the function H5O_dset_bh_info.  This is to prevent memory leak.
 
Tested on jam and tested 1.8 on jam, too - simple fix.
This commit is contained in:
Raymond Lu 2010-03-05 12:05:02 -05:00
parent f47421b6c9
commit 3a06e04ac5

@ -359,6 +359,10 @@ done:
* Programmer: Vailin Choi
* July 11, 2007
*
* Modification:Raymond Lu
* 5 February, 2010
* I added the call to H5O_msg_reset after H5D_chunk_bh_info
* to free the PLINE.
*-------------------------------------------------------------------------
*/
static herr_t
@ -382,6 +386,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
/* Check for chunked dataset storage */
if(layout.type == H5D_CHUNKED && H5D_chunk_is_space_alloc(&layout.storage)) {
H5O_pline_t pline; /* I/O pipeline message */
herr_t ret = SUCCEED;
/* Check for I/O pipeline message */
if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0)
@ -393,7 +398,12 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
else
HDmemset(&pline, 0, sizeof(pline));
if(H5D_chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size)) < 0)
ret = H5D_chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size));
/* Free the PLINE after using it */
H5O_msg_reset(H5O_PLINE_ID, &pline);
if(ret < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info")
} /* end if */