Skip to content

Commit 80beb30

Browse files
committed
coll/sync: plug a memory leak
1 parent 0931d09 commit 80beb30

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ompi/mca/coll/sync/coll_sync_module.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2016 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -93,16 +95,17 @@ mca_coll_sync_comm_query(struct ompi_communicator_t *comm,
9395
{
9496
mca_coll_sync_module_t *sync_module;
9597

96-
sync_module = OBJ_NEW(mca_coll_sync_module_t);
97-
if (NULL == sync_module) {
98-
return NULL;
99-
}
100-
10198
/* If both MCA params are 0, then disqualify us */
10299
if (0 == mca_coll_sync_component.barrier_before_nops &&
103100
0 == mca_coll_sync_component.barrier_after_nops) {
104101
return NULL;
105102
}
103+
104+
sync_module = OBJ_NEW(mca_coll_sync_module_t);
105+
if (NULL == sync_module) {
106+
return NULL;
107+
}
108+
106109
*priority = mca_coll_sync_component.priority;
107110

108111
/* Choose whether to use [intra|inter] */

0 commit comments

Comments
 (0)