1
1

- 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.
Этот коммит содержится в:
Rainer Keller 2008-08-11 09:43:01 +00:00
родитель da765cf68a
Коммит 9cc83d7414

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

@ -6,7 +6,7 @@
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* 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.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -552,8 +552,9 @@ static int ompi_comm_allreduce_inter ( int *inbuf, int *outbuf,
tmpbuf = (int *) malloc ( count * sizeof(int));
rdisps = (int *) calloc ( rsize, sizeof(int));
rcounts = (int *) calloc ( rsize, sizeof(int) );
if ( NULL == tmpbuf || NULL == rdisps || NULL == rcounts ) {
return OMPI_ERR_OUT_OF_RESOURCE;
if ( OPAL_UNLIKELY (NULL == tmpbuf || NULL == rdisps || NULL == rcounts)) {
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
/* 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 );
tmpbuf = (int *) malloc ( count * sizeof(int));
if ( NULL == tmpbuf ) {
return MPI_ERR_INTERN;
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
/* Intercomm_create */
@ -764,7 +766,8 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
local_rank = ompi_comm_rank ( comm );
tmpbuf = (int *) malloc ( count * sizeof(int));
if ( NULL == tmpbuf ) {
return MPI_ERR_INTERN;
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
/* comm is an intra-communicator */