Skip to content

Commit a3e31fa

Browse files
committed
ompi/communicator: plug a memory leak in ompi_comm_init()
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 9d3f451 commit a3e31fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ompi/communicator/comm_init.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Copyright (c) 2011-2013 Inria. All rights reserved.
1919
* Copyright (c) 2011-2013 Universite Bordeaux 1
2020
* All rights reserved.
21-
* Copyright (c) 2015 Research Organization for Information Science
21+
* Copyright (c) 2015-2017 Research Organization for Information Science
2222
* and Technology (RIST). All rights reserved.
2323
* Copyright (c) 2015 Intel, Inc. All rights reserved.
2424
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
@@ -167,6 +167,9 @@ int ompi_comm_init(void)
167167
if ( strstr ( str, "BYNODE") ) {
168168
OMPI_COMM_SET_MAPBY_NODE(&ompi_mpi_comm_world.comm);
169169
}
170+
if (NULL != str) {
171+
free(str);
172+
}
170173
}
171174
/* Setup MPI_COMM_SELF */
172175
OBJ_CONSTRUCT(&ompi_mpi_comm_self, ompi_communicator_t);

0 commit comments

Comments
 (0)