summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-05-22 15:09:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-05-22 15:09:31 (GMT)
commit668d8d5aa3d169182254febff02b725eb5a433cf (patch)
treeb0400e1c806bd4db233232f4b899eddc7a311416
parent517ed323b5a651df4b937aa5082cbe348955fe88 (diff)
downloadhdf5-668d8d5aa3d169182254febff02b725eb5a433cf.zip
hdf5-668d8d5aa3d169182254febff02b725eb5a433cf.tar.gz
hdf5-668d8d5aa3d169182254febff02b725eb5a433cf.tar.bz2
[svn-r13784] Description:
Close memory leak in error situation for opening a dataset. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
-rw-r--r--src/H5D.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 932d453..cad1742 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1939,8 +1939,14 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
} /* end if */
if(dataset->shared->type) {
- if(H5I_dec_ref(dataset->shared->type_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
+ if(dataset->shared->type_id > 0) {
+ if(H5I_dec_ref(dataset->shared->type_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
+ } /* end if */
+ else {
+ if(H5T_close(dataset->shared->type) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
+ } /* end else */
} /* end if */
} /* end if */