From fea95186eba929f27ad4c34a9ec1308c8ca3d007 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 11 Nov 2021 18:44:00 -0600 Subject: [PATCH] Fix MPI Comm and Info leak in H5FD__mpio_delete --- src/H5FDmpio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f8ac610c405..67b01f18570 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1804,6 +1804,12 @@ H5FD__mpio_delete(const char *filename, hid_t fapl_id) HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) done: + /* Free duplicated MPI Communicator and Info objects */ + if (H5_mpi_comm_free(&comm) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI communicator") + if (H5_mpi_info_free(&info) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI info object") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__mpio_delete() */