1
1

ompi/group: get rid of malloc(0) in ompi_group_intersection(...)

Thanks Lisandro Dalcin for the report

Fixes open-mpi/ompi#1866
Этот коммит содержится в:
Gilles Gouaillardet 2016-07-14 11:19:46 +09:00
родитель 1ceb35ba5c
Коммит c3c262b3a8

Просмотреть файл

@ -16,7 +16,7 @@
* Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -453,9 +453,11 @@ int ompi_group_intersection(ompi_group_t* group1,ompi_group_t* group2,
k = 0; k = 0;
/* allocate the max required memory */ /* allocate the max required memory */
ranks_included = (int *)malloc(group1_pointer->grp_proc_count*(sizeof(int))); if (0 < group1_pointer->grp_proc_count) {
if (NULL == ranks_included) { ranks_included = (int *)malloc(group1_pointer->grp_proc_count*(sizeof(int)));
return MPI_ERR_NO_MEM; if (NULL == ranks_included) {
return MPI_ERR_NO_MEM;
}
} }
/* determine the list of included processes for the incl-method */ /* determine the list of included processes for the incl-method */
k = 0; k = 0;