1
1

last nights coverty fix introduced a new coverty complain. This commit tries to fix the new complain by coverty.

Этот коммит содержится в:
Edgar Gabriel 2015-08-25 08:46:38 -05:00
родитель 9023af5c20
Коммит 6f2e8d2073
2 изменённых файлов: 18 добавлений и 7 удалений

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

@ -350,7 +350,7 @@
} }
for(l=0;l<fh->f_procs_per_group;l++){ for(l=0;l<fh->f_procs_per_group;l++){
sendtype[l] = MPI_DATATYPE_NULL;
disp_index[l] = 1; disp_index[l] = 1;
if (NULL != blocklen_per_process[l]){ if (NULL != blocklen_per_process[l]){
@ -804,8 +804,11 @@
free (global_buf); free (global_buf);
global_buf = NULL; global_buf = NULL;
} }
for (i = 0; i < fh->f_procs_per_group; i++) for (i = 0; i < fh->f_procs_per_group; i++) {
ompi_datatype_destroy(sendtype+i); if ( MPI_DATATYPE_NULL != sendtype[i] ){
ompi_datatype_destroy(&sendtype[i]);
}
}
if (NULL != sendtype){ if (NULL != sendtype){
free(sendtype); free(sendtype);
sendtype=NULL; sendtype=NULL;
@ -902,7 +905,9 @@
} }
if (NULL != sendtype){ if (NULL != sendtype){
for (i = 0; i < fh->f_procs_per_group; i++) { for (i = 0; i < fh->f_procs_per_group; i++) {
ompi_datatype_destroy(sendtype+i); if ( MPI_DATATYPE_NULL != sendtype[i] ) {
ompi_datatype_destroy(&sendtype[i]);
}
} }
free(sendtype); free(sendtype);
sendtype=NULL; sendtype=NULL;

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

@ -372,6 +372,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
} }
for(l=0;l<fh->f_procs_per_group;l++){ for(l=0;l<fh->f_procs_per_group;l++){
recvtype[i] = MPI_DATATYPE_NULL;
disp_index[l] = 1; disp_index[l] = 1;
if (NULL != blocklen_per_process[l]){ if (NULL != blocklen_per_process[l]){
@ -952,9 +953,12 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
free (fh->f_io_array); free (fh->f_io_array);
fh->f_io_array = NULL; fh->f_io_array = NULL;
} }
for (i =0; i< fh->f_procs_per_group; i++)
ompi_datatype_destroy(recvtype+i);
if (NULL != recvtype){ if (NULL != recvtype){
for (i =0; i< fh->f_procs_per_group; i++) {
if ( MPI_DATATYPE_NULL != recvtype[i] ) {
ompi_datatype_destroy(&recvtype[i]);
}
}
free(recvtype); free(recvtype);
recvtype=NULL; recvtype=NULL;
} }
@ -1006,7 +1010,9 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
} }
if (NULL != recvtype){ if (NULL != recvtype){
for (i =0; i< fh->f_procs_per_group; i++) { for (i =0; i< fh->f_procs_per_group; i++) {
ompi_datatype_destroy(recvtype+i); if ( MPI_DATATYPE_NULL != recvtype[i] ) {
ompi_datatype_destroy(&recvtype[i]);
}
} }
free(recvtype); free(recvtype);
recvtype=NULL; recvtype=NULL;