Skip to content

Commit f7d1829

Browse files
committed
Fix resource leak reported by coverity scan report CID 1515816
Free memory allocated for ranks array before returning from erroneous call to ompi_comm_split_type_get_part. Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
1 parent e40ca0d commit f7d1829

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ompi/communicator/comm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2004-2019 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
9-
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* Copyright (c) 2004-2022 High Performance Computing Center Stuttgart,
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
@@ -814,6 +814,7 @@ static int ompi_comm_split_type_get_part (ompi_group_t *group, const int split_t
814814
true,
815815
ompi_comm_split_type_to_str(split_type),
816816
split_type);
817+
free (ranks);
817818
return OMPI_ERR_BAD_PARAM;
818819
}
819820

0 commit comments

Comments
 (0)