summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>2000-11-10 14:34:01 (GMT)
committerRobb Matzke <matzke@llnl.gov>2000-11-10 14:34:01 (GMT)
commit165359045ed58ae20ae5f36ca798681eff4adfff (patch)
tree4e47293d3b0848f8583ec4cd2388cde4365e20dd
parentab5bf9f979fed3a665f302b4e8b93ca1628b5d23 (diff)
downloadhdf5-165359045ed58ae20ae5f36ca798681eff4adfff.zip
hdf5-165359045ed58ae20ae5f36ca798681eff4adfff.tar.gz
hdf5-165359045ed58ae20ae5f36ca798681eff4adfff.tar.bz2
[svn-r2852] ./hdf5/src/H5FD.c
* 2000-11-10 Robb Matzke <matzke@llnl.gov> (H5FD_close) Removed code that resets the H5FD_t file structure to zero because that struct has already been freed. This fixes a core dump on some platforms.
-rw-r--r--src/H5FD.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 25a7c25..aea02c2 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -851,7 +851,10 @@ H5FDclose(H5FD_t *file)
* Wednesday, August 4, 1999
*
* Modifications:
- *
+ * Robb Matzke, 2000-11-10
+ * Removed a call to set *file to all zero because the struct
+ * has already been freed by the close method. This fixes a write
+ * to freed memory.
*-------------------------------------------------------------------------
*/
herr_t
@@ -868,8 +871,9 @@ H5FD_close(H5FD_t *file)
FUNC_ENTER(H5FD_close, FAIL);
assert(file && file->cls);
- /* Free all free-lists, leaking any memory thus described */
- /* Also leaks file space allocated but not used when metadata aggregation is turned on */
+ /* Free all free-lists, leaking any memory thus described. Also leaks
+ * file space allocated but not used when metadata aggregation is
+ * turned on. */
for (i=H5FD_MEM_DEFAULT; i<H5FD_MEM_NTYPES; i++) {
for (cur=file->fl[i]; cur; cur=next) {
#ifdef H5F_DEBUG
@@ -913,8 +917,6 @@ H5FD_close(H5FD_t *file)
if ((driver->close)(file)<0) {
HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "close failed");
}
- HDmemset(file, 0, sizeof(H5FD_t));
-
FUNC_LEAVE(SUCCEED);
}