diff --git a/ompi/mca/pml/ucx/pml_ucx_request.c b/ompi/mca/pml/ucx/pml_ucx_request.c index 3b86c7ab70..552dbd17d0 100644 --- a/ompi/mca/pml/ucx/pml_ucx_request.c +++ b/ompi/mca/pml/ucx/pml_ucx_request.c @@ -166,7 +166,8 @@ static int mca_pml_ucx_persistent_request_free(ompi_request_t **rptr) mca_pml_ucx_persistent_request_detach(preq, tmp_req); ucp_request_free(tmp_req); } - if (MCA_PML_BASE_SEND_BUFFERED == preq->send.mode) { + if ((preq->flags & MCA_PML_UCX_REQUEST_FLAG_SEND) && + (MCA_PML_BASE_SEND_BUFFERED == preq->send.mode)) { OBJ_RELEASE(preq->ompi_datatype); } PML_UCX_FREELIST_RETURN(&ompi_pml_ucx.persistent_reqs, &preq->ompi.super);