Skip to content

Commit ae0db67

Browse files
committed
coll/acoll: plug a memory leak
Have mca_coll_acoll_comm_query() not leak when invoked on an inter-communicator nor a single process communicator. Refs. #13070 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent c5e02ab commit ae0db67

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ompi/mca/coll/acoll/coll_acoll_module.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ mca_coll_base_module_t *mca_coll_acoll_comm_query(struct ompi_communicator_t *co
6060
{
6161
mca_coll_acoll_module_t *acoll_module;
6262

63-
acoll_module = OBJ_NEW(mca_coll_acoll_module_t);
64-
if (NULL == acoll_module) {
65-
return NULL;
66-
}
67-
6863
if (OMPI_COMM_IS_INTER(comm)) {
6964
*priority = 0;
7065
return NULL;
@@ -74,6 +69,11 @@ mca_coll_base_module_t *mca_coll_acoll_comm_query(struct ompi_communicator_t *co
7469
return NULL;
7570
}
7671

72+
acoll_module = OBJ_NEW(mca_coll_acoll_module_t);
73+
if (NULL == acoll_module) {
74+
return NULL;
75+
}
76+
7777
*priority = mca_coll_acoll_priority;
7878

7979
/* Set topology params */

0 commit comments

Comments
 (0)