@@ -583,7 +583,10 @@ int ompi_coll_base_reduce_intra_in_order_binary( const void *sendbuf, void *recv
583583 op , io_root , comm , module ,
584584 data -> cached_in_order_bintree ,
585585 segcount , max_outstanding_reqs );
586- if (MPI_SUCCESS != ret ) { return ret ; }
586+ if (MPI_SUCCESS != ret ) {
587+ free (tmpbuf_free );
588+ return ret ;
589+ }
587590
588591 /* Clean up */
589592 if (io_root != root ) {
@@ -592,14 +595,20 @@ int ompi_coll_base_reduce_intra_in_order_binary( const void *sendbuf, void *recv
592595 ret = MCA_PML_CALL (recv (recvbuf , count , datatype , io_root ,
593596 MCA_COLL_BASE_TAG_REDUCE , comm ,
594597 MPI_STATUS_IGNORE ));
595- if (MPI_SUCCESS != ret ) { return ret ; }
598+ if (MPI_SUCCESS != ret ) {
599+ free (tmpbuf_free );
600+ return ret ;
601+ }
596602
597603 } else if (io_root == rank ) {
598604 /* Send result from use_this_recvbuf to root */
599605 ret = MCA_PML_CALL (send (use_this_recvbuf , count , datatype , root ,
600606 MCA_COLL_BASE_TAG_REDUCE ,
601607 MCA_PML_BASE_SEND_STANDARD , comm ));
602- if (MPI_SUCCESS != ret ) { return ret ; }
608+ if (MPI_SUCCESS != ret ) {
609+ free (tmpbuf_free );
610+ return ret ;
611+ }
603612 }
604613 }
605614 if (NULL != tmpbuf_free ) {
0 commit comments