Skip to content

Commit 3ad5943

Browse files
committed
mtl/ofi: Prevent possible memory leak.
1 parent 8c92a17 commit 3ad5943

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,11 +860,13 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
860860
* The search request completed but no matching message was found.
861861
*/
862862
*matched = 0;
863+
free(ofi_req);
863864
return OMPI_SUCCESS;
864865
} else if (OPAL_UNLIKELY(0 > ret)) {
865866
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
866867
"%s:%d: fi_trecvmsg failed: %s(%zd)",
867868
__FILE__, __LINE__, fi_strerror(-ret), ret);
869+
free(ofi_req);
868870
return ompi_mtl_ofi_get_error(ret);
869871
}
870872

@@ -890,6 +892,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
890892

891893
} else {
892894
(*message) = MPI_MESSAGE_NULL;
895+
free(ofi_req);
893896
}
894897

895898
return OMPI_SUCCESS;

0 commit comments

Comments
 (0)