Skip to content

Commit 7a3751e

Browse files
committed
coll/libnbc: fix coverity errors
Fix CID 1196812: Resource Leak dsts array was leaked on error. Fix CID 710565: Copy-paste error The line in question (nbc:513) is indeed a copy-paste error. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from open-mpi/ompi@30f8d0b)
1 parent 21ecfc6 commit 7a3751e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ompi/mca/coll/libnbc/nbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static inline int NBC_Start_round(NBC_Handle *handle) {
508508
if(unpackargs.tmpinbuf) {
509509
buf1=(char*)handle->tmpbuf+(long)unpackargs.inbuf;
510510
} else {
511-
buf1=unpackargs.outbuf;
511+
buf1=unpackargs.inbuf;
512512
}
513513
if(unpackargs.tmpoutbuf) {
514514
buf2=(char*)handle->tmpbuf+(long)unpackargs.outbuf;

ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ int ompi_coll_libnbc_ineighbor_alltoallw(void *sbuf, int *scounts, MPI_Aint *sdi
8585
free (srcs);
8686

8787
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
88+
free (dsts);
8889
OBJ_RELEASE(schedule);
8990
return res;
9091
}

0 commit comments

Comments
 (0)