Skip to content

Commit 7aa4d34

Browse files
committed
Silence coverty warnings 1321702, 1321701, 1321700, 72331, 72330, 72327, 72326, 72325,
1 parent 4fd552d commit 7aa4d34

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,6 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
730730
temp_disp_index = NULL;
731731
}
732732

733-
send_req = (MPI_Request *)
734-
malloc (fh->f_procs_per_group * sizeof(MPI_Request));
735-
if (NULL == send_req){
736-
opal_output ( 1, "OUT OF MEMORY\n");
737-
ret = OMPI_ERR_OUT_OF_RESOURCE;
738-
goto exit;
739-
}
740733
#if OMPIO_FCOLL_WANT_TIME_BREAKDOWN
741734
start_rcomm_time = MPI_Wtime();
742735
#endif
@@ -965,7 +958,10 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
965958
free(displs_per_process);
966959
displs_per_process = NULL;
967960
}
968-
961+
if ( NULL != send_req ) {
962+
free ( send_req );
963+
send_req = NULL;
964+
}
969965
}
970966
return ret;
971967
}

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,8 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
713713
temp_disp_index = (int *)calloc (1, fh->f_procs_per_group * sizeof (int));
714714
if (NULL == temp_disp_index) {
715715
opal_output (1, "OUT OF MEMORY\n");
716-
return OMPI_ERR_OUT_OF_RESOURCE;
716+
ret = OMPI_ERR_OUT_OF_RESOURCE;
717+
goto exit;
717718
}
718719

719720
/*Now update the displacements array with memory offsets*/
@@ -815,7 +816,8 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
815816
send_buf = malloc (bytes_sent);
816817
if (NULL == send_buf) {
817818
opal_output (1, "OUT OF MEMORY\n");
818-
return OMPI_ERR_OUT_OF_RESOURCE;
819+
ret = OMPI_ERR_OUT_OF_RESOURCE;
820+
goto exit;
819821
}
820822

821823
remaining = bytes_sent;

0 commit comments

Comments
 (0)