diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-22 15:09:31 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-22 15:09:31 (GMT) |
commit | 668d8d5aa3d169182254febff02b725eb5a433cf (patch) | |
tree | b0400e1c806bd4db233232f4b899eddc7a311416 /src | |
parent | 517ed323b5a651df4b937aa5082cbe348955fe88 (diff) | |
download | hdf5-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)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5D.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 */ |