- Fix the freeing of already allocated buffers, if one fails.
Fixes Coverity CID 291 & CID 292 - Adjust the rc for other functions as well. This commit was SVN r19232.
Этот коммит содержится в:
родитель
da765cf68a
Коммит
9cc83d7414
@ -6,7 +6,7 @@
|
|||||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||||
* of Tennessee Research Foundation. All rights
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -552,8 +552,9 @@ static int ompi_comm_allreduce_inter ( int *inbuf, int *outbuf,
|
|||||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||||
rdisps = (int *) calloc ( rsize, sizeof(int));
|
rdisps = (int *) calloc ( rsize, sizeof(int));
|
||||||
rcounts = (int *) calloc ( rsize, sizeof(int) );
|
rcounts = (int *) calloc ( rsize, sizeof(int) );
|
||||||
if ( NULL == tmpbuf || NULL == rdisps || NULL == rcounts ) {
|
if ( OPAL_UNLIKELY (NULL == tmpbuf || NULL == rdisps || NULL == rcounts)) {
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Execute the inter-allreduce: the result of our group will
|
/* Execute the inter-allreduce: the result of our group will
|
||||||
@ -666,7 +667,8 @@ static int ompi_comm_allreduce_intra_bridge (int *inbuf, int *outbuf,
|
|||||||
local_rank = ompi_comm_rank ( comm );
|
local_rank = ompi_comm_rank ( comm );
|
||||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||||
if ( NULL == tmpbuf ) {
|
if ( NULL == tmpbuf ) {
|
||||||
return MPI_ERR_INTERN;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Intercomm_create */
|
/* Intercomm_create */
|
||||||
@ -764,7 +766,8 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
|
|||||||
local_rank = ompi_comm_rank ( comm );
|
local_rank = ompi_comm_rank ( comm );
|
||||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||||
if ( NULL == tmpbuf ) {
|
if ( NULL == tmpbuf ) {
|
||||||
return MPI_ERR_INTERN;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* comm is an intra-communicator */
|
/* comm is an intra-communicator */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user