From 165359045ed58ae20ae5f36ca798681eff4adfff Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Fri, 10 Nov 2000 09:34:01 -0500 Subject: [svn-r2852] ./hdf5/src/H5FD.c * 2000-11-10 Robb Matzke (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. --- src/H5FD.c | 12 +++++++----- 1 file 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; ifl[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); } -- cgit v0.12