diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2010-02-17 17:45:37 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2010-02-17 17:45:37 (GMT) |
commit | 88c692130081999896f690fc2b9b0bf9c3a02d9f (patch) | |
tree | 80a1cf32f5a0bcfc10a78771c5696e9320f46944 /src/H5F.c | |
parent | ad9e876b0c767c97fdbef57509f3395768e58b44 (diff) | |
download | hdf5-88c692130081999896f690fc2b9b0bf9c3a02d9f.zip hdf5-88c692130081999896f690fc2b9b0bf9c3a02d9f.tar.gz hdf5-88c692130081999896f690fc2b9b0bf9c3a02d9f.tar.bz2 |
[svn-r18269] Bug fix for #1732 - The library had segmentation fault when tools call H5Close() after trying
to open corrupted files. The problem turned out to be some memory leak when the library
failed to open the file. The solution is simply moving some code around to their proper
places - moving H5AC_unpin_entry(f->shared->sblock) in H5F_dest of H5F.c and moving
H5G_name_free(root_loc.path) in H5G_mkroot of H5Groot.c.
Tested on jam. Tested the same change for 1.8.
M src/H5F.c
M src/H5Groot.c
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1001,14 +1001,16 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") } /* end if */ + } /* end if */ - /* Unpin the superblock, since we're about to destroy the cache */ + /* Unpin the superblock, since we're about to destroy the cache */ + if(f->shared->sblock) { if(H5AC_unpin_entry(f->shared->sblock) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") f->shared->sblock = NULL; - } /* end if */ - + } + /* Remove shared file struct from list of open files */ if(H5F_sfile_remove(f->shared) < 0) /* Push error, but keep going*/ |