[dcmf] [PATCH 8/9] paranoid frees

Rob Latham robl at mcs.anl.gov
Fri Feb 15 13:50:32 CST 2008


Signed-off-by: Rob Latham <robl at mcs.anl.gov>
---
 .../src/mpi/romio/adio/ad_bgl/ad_bgl_close.c       |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c b/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
index 844d5d6..d8db6ba 100644
--- a/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
+++ b/lib/mpi/mpich2/src/mpi/romio/adio/ad_bgl/ad_bgl_close.c
@@ -40,8 +40,10 @@ void ADIOI_BGL_Close(ADIO_File fd, int *error_code)
 #endif
 
 /*  FPRINTF(stderr,"%s(%d):'%s'. Free %#X\n",myname,__LINE__,fd->filename,(int)fd->fs_ptr);*/
-  ADIOI_Free(fd->fs_ptr);
-  fd->fs_ptr = NULL;
+  if (fd->fs_ptr != NULL) {
+	  ADIOI_Free(fd->fs_ptr);
+	  fd->fs_ptr = NULL;
+  }
   fd->fd_sys    = -1;
   fd->fd_direct = -1;
 
-- 
1.5.3.8




More information about the dcmf mailing list