From 5d3cd01db4d6a80961d0189d02094491d272c982 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 9 Jun 2020 14:40:03 +0200 Subject: [PATCH] leaks -- These lines were not supposed to be included in latest commit. But as I had already written the commit message warning of memory leaks, I decided to add them anymway, in order not to lie. --- src/smpi/mpi/smpi_request.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 4d282ae873..7812f96a1e 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -855,18 +855,15 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status) // This part handles the problem of non-contiguous memory the unserialization at the reception if ((req->flags_ & MPI_REQ_RECV) && datatype->size() != 0) datatype->unserialize(req->buf_, req->old_buf_, req->real_size_/datatype->size() , req->op_); - if(req->flags_ & MPI_REQ_NON_PERSISTENT){ - xbt_free(req->buf_); - req->buf_=nullptr; - } + xbt_free(req->buf_); + req->buf_=nullptr; } else if (req->flags_ & MPI_REQ_RECV) { // apply op on contiguous buffer for accumulate if (datatype->size() != 0) { int n = req->real_size_ / datatype->size(); req->op_->apply(req->buf_, req->old_buf_, &n, datatype); } - if(req->flags_ & MPI_REQ_NON_PERSISTENT) - xbt_free(req->buf_); - req->buf_=nullptr; + xbt_free(req->buf_); + req->buf_=nullptr; } } } -- 2.20.1