summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-09-13 16:29:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-09-13 16:29:30 (GMT)
commit18758623d78ff9fbd4880761da6d40fdfe44c945 (patch)
tree76062a59714944a4d7123dc0f6f14e3dd140ced9 /src/H5D.c
parentf0f56c0c0a708812294a6192aa1979efd3ccba6e (diff)
downloadhdf5-18758623d78ff9fbd4880761da6d40fdfe44c945.zip
hdf5-18758623d78ff9fbd4880761da6d40fdfe44c945.tar.gz
hdf5-18758623d78ff9fbd4880761da6d40fdfe44c945.tar.bz2
[svn-r5925] Purpose:
Code cleanup Description: Eliminate memory leak of compact storage raw data buffer found by purify. Platforms tested: FreeBSD 4.6 (sleipnir) w/C++ Solaris 2.7 (arabica) w/C++ IRIX64 6.5 (modi4) w/parallel & FORTRAN
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 9f81ed0..0a3b78c 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2184,12 +2184,12 @@ H5D_close(H5D_t *dataset)
free_failed = (H5T_close(dataset->type) < 0 ||
H5I_dec_ref(dataset->dcpl_id) < 0);
- /*Update header message of layout for compact dataset.*/
+ /* Update header message of layout for compact dataset. */
if(dataset->layout.type==H5D_COMPACT && dataset->layout.dirty) {
if(H5O_modify(&(dataset->ent), H5O_LAYOUT, 0, 0, &(dataset->layout))<0)
HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout message");
dataset->layout.dirty = FALSE;
- }
+ } /* end if */
/* Close the dataset object */
H5O_close(&(dataset->ent));
@@ -2201,6 +2201,9 @@ H5D_close(H5D_t *dataset)
* above).
*/
dataset->ent.file = NULL;
+ /* Free the buffer for the raw data for compact datasets */
+ if(dataset->layout.type==H5D_COMPACT)
+ dataset->layout.buf=H5MM_xfree(dataset->layout.buf);
H5FL_FREE(H5D_t,dataset);
if (free_failed)