summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-06-18 20:41:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-06-18 20:41:28 (GMT)
commit4e3716dd662c626322a80f40416deaec097db04d (patch)
tree4a2020b17de8e5335c75e52ae08d9b4026dd9c7f /src/H5Tcommit.c
parent780d678dddaafc42df1047d8537d9482bd6dcecd (diff)
downloadhdf5-4e3716dd662c626322a80f40416deaec097db04d.zip
hdf5-4e3716dd662c626322a80f40416deaec097db04d.tar.gz
hdf5-4e3716dd662c626322a80f40416deaec097db04d.tar.bz2
[svn-r7053] Purpose:
Bug fix. Description: When a duplicate object was attempted to be created, the library would leak file memory and object references in the file, potentially causing an infinite loop when shutting the library down. Solution: Clean up after ourselves... :-) Platforms tested: FreeBSD 4.8 (sleipnir) h5committest
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 1b2b64c..831c580 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -160,7 +160,10 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
done:
if (ret_value<0) {
if ((type->state==H5T_STATE_TRANSIENT || type->state==H5T_STATE_RDONLY) && H5F_addr_defined(type->ent.header)) {
- H5O_close(&(type->ent));
+ if(H5O_close(&(type->ent))<0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header");
+ if(H5O_delete(file, dxpl_id,type->ent.header)<0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header");
type->ent.header = HADDR_UNDEF;
}
}