@@ -583,7 +583,10 @@ int ompi_coll_base_reduce_intra_in_order_binary( const void *sendbuf, void *recv
583
583
op , io_root , comm , module ,
584
584
data -> cached_in_order_bintree ,
585
585
segcount , max_outstanding_reqs );
586
- if (MPI_SUCCESS != ret ) { return ret ; }
586
+ if (MPI_SUCCESS != ret ) {
587
+ free (tmpbuf_free );
588
+ return ret ;
589
+ }
587
590
588
591
/* Clean up */
589
592
if (io_root != root ) {
@@ -592,14 +595,20 @@ int ompi_coll_base_reduce_intra_in_order_binary( const void *sendbuf, void *recv
592
595
ret = MCA_PML_CALL (recv (recvbuf , count , datatype , io_root ,
593
596
MCA_COLL_BASE_TAG_REDUCE , comm ,
594
597
MPI_STATUS_IGNORE ));
595
- if (MPI_SUCCESS != ret ) { return ret ; }
598
+ if (MPI_SUCCESS != ret ) {
599
+ free (tmpbuf_free );
600
+ return ret ;
601
+ }
596
602
597
603
} else if (io_root == rank ) {
598
604
/* Send result from use_this_recvbuf to root */
599
605
ret = MCA_PML_CALL (send (use_this_recvbuf , count , datatype , root ,
600
606
MCA_COLL_BASE_TAG_REDUCE ,
601
607
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
+ }
603
612
}
604
613
}
605
614
if (NULL != tmpbuf_free ) {
0 commit comments