correctly free some arrays in case of an error. This fixes a whole bunch of coverty warnings.
Этот коммит содержится в:
родитель
b4fcd3897e
Коммит
db2d37ad93
@ -851,6 +851,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
if (!(fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
||||||
|
if (NULL != receive_buf) {
|
||||||
|
free (receive_buf);
|
||||||
|
receive_buf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (NULL != global_buf) {
|
||||||
|
free (global_buf);
|
||||||
|
global_buf = NULL;
|
||||||
|
}
|
||||||
if (NULL != sorted) {
|
if (NULL != sorted) {
|
||||||
free (sorted);
|
free (sorted);
|
||||||
sorted = NULL;
|
sorted = NULL;
|
||||||
@ -878,6 +888,26 @@
|
|||||||
}
|
}
|
||||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
||||||
|
|
||||||
|
if (NULL != sorted_file_offsets){
|
||||||
|
free(sorted_file_offsets);
|
||||||
|
sorted_file_offsets = NULL;
|
||||||
|
}
|
||||||
|
if (NULL != file_offsets_for_agg){
|
||||||
|
free(file_offsets_for_agg);
|
||||||
|
file_offsets_for_agg = NULL;
|
||||||
|
}
|
||||||
|
if (NULL != memory_displacements){
|
||||||
|
free(memory_displacements);
|
||||||
|
memory_displacements= NULL;
|
||||||
|
}
|
||||||
|
if (NULL != sendtype){
|
||||||
|
for (i = 0; i < fh->f_procs_per_group; i++) {
|
||||||
|
ompi_datatype_destroy(sendtype+i);
|
||||||
|
}
|
||||||
|
free(sendtype);
|
||||||
|
sendtype=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != disp_index){
|
if (NULL != disp_index){
|
||||||
free(disp_index);
|
free(disp_index);
|
||||||
disp_index = NULL;
|
disp_index = NULL;
|
||||||
|
@ -992,6 +992,26 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
exit :
|
exit :
|
||||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
||||||
|
if (NULL != sorted_file_offsets){
|
||||||
|
free(sorted_file_offsets);
|
||||||
|
sorted_file_offsets = NULL;
|
||||||
|
}
|
||||||
|
if(NULL != file_offsets_for_agg){
|
||||||
|
free(file_offsets_for_agg);
|
||||||
|
file_offsets_for_agg = NULL;
|
||||||
|
}
|
||||||
|
if (NULL != memory_displacements){
|
||||||
|
free(memory_displacements);
|
||||||
|
memory_displacements = NULL;
|
||||||
|
}
|
||||||
|
if (NULL != recvtype){
|
||||||
|
for (i =0; i< fh->f_procs_per_group; i++) {
|
||||||
|
ompi_datatype_destroy(recvtype+i);
|
||||||
|
}
|
||||||
|
free(recvtype);
|
||||||
|
recvtype=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != fh->f_io_array) {
|
if (NULL != fh->f_io_array) {
|
||||||
free (fh->f_io_array);
|
free (fh->f_io_array);
|
||||||
fh->f_io_array = NULL;
|
fh->f_io_array = NULL;
|
||||||
@ -1033,6 +1053,16 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! (fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
||||||
|
if (NULL != send_buf) {
|
||||||
|
free (send_buf);
|
||||||
|
send_buf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (NULL != global_buf) {
|
||||||
|
free (global_buf);
|
||||||
|
global_buf = NULL;
|
||||||
|
}
|
||||||
if (NULL != sorted) {
|
if (NULL != sorted) {
|
||||||
free (sorted);
|
free (sorted);
|
||||||
sorted = NULL;
|
sorted = NULL;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user