summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-13 19:17:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-13 19:17:29 (GMT)
commit92b37616d2a1ec34a2d7bd34d05c5f6466f7da53 (patch)
tree782bdfeee57df4a5fc673c47c1917e92f6262468 /src/H5Dchunk.c
parent5e435bd8ac0b1d59a2c8461b960434b49b50a25f (diff)
downloadhdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.zip
hdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.tar.gz
hdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.tar.bz2
[svn-r17354] Description:
Bring r17351 from trunk to 1.8 branch: Clean up code (to align w/future sblock_mdc branch changes), tweak tests for [slightly] easier debugging, fix memory leak when copying chunked datasets with I/O filters, fix memory leak of free space section when it was exactly the right size to use for extending an existing block in the file. Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committest performed on trunk)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index b22a097..0d0c77a 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -3967,7 +3967,9 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5O_layout_t layout; /* Dataset layout message */
+ hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */
H5O_pline_t pline; /* I/O pipeline message */
+ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */
htri_t exists; /* Flag if header message of interest exists */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3984,6 +3986,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
else if(exists) {
if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_PLINE_ID, &pline))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O pipeline message")
+ pline_read = TRUE;
} /* end else if */
else
HDmemset(&pline, 0, sizeof(pline));
@@ -3994,6 +3997,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
else if(exists) {
if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message")
+ layout_read = TRUE;
} /* end else if */
else
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "can't find layout message")
@@ -4010,6 +4014,14 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk index")
done:
+ /* Clean up any messages read in */
+ if(pline_read)
+ if(H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
+ if(layout_read)
+ if(H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_chunk_delete() */