Skip to content

Commit 9282261

Browse files
committed
fcoll/dynamic_gen2: fix coverty warnings
fix warnings for coverty CID 1433655 and CID 1433654 Signed-off-by: raafatfeki <[email protected]>
1 parent 44a1c78 commit 9282261

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ exit :
698698
}
699699
free (aggr_data);
700700
}
701+
free(local_iov_array);
701702
free(displs);
702703
free(decoded_iov);
703704
free(broken_counts);
@@ -768,6 +769,8 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
768769
MPI_Aint *memory_displacements=NULL;
769770
int *temp_disp_index=NULL;
770771
MPI_Aint global_count = 0;
772+
int* blocklength_proc=NULL;
773+
ptrdiff_t* displs_proc=NULL;
771774

772775
data->num_io_entries = 0;
773776
data->bytes_sent = 0;
@@ -1137,8 +1140,8 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
11371140

11381141
ptrdiff_t send_mem_address = NULL;
11391142
ompi_datatype_t *newType = MPI_DATATYPE_NULL;
1140-
int* blocklength_proc = (int *) calloc (blocklength_size, sizeof (int));
1141-
ptrdiff_t* displs_proc = (ptrdiff_t *) calloc (blocklength_size, sizeof (ptrdiff_t));
1143+
blocklength_proc = (int *) calloc (blocklength_size, sizeof (int));
1144+
displs_proc = (ptrdiff_t *) calloc (blocklength_size, sizeof (ptrdiff_t));
11421145

11431146
if (NULL == blocklength_proc || NULL == displs_proc ) {
11441147
opal_output (1, "OUT OF MEMORY\n");
@@ -1200,16 +1203,13 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
12001203
MCA_PML_BASE_SEND_STANDARD,
12011204
data->comm,
12021205
&reqs[data->procs_per_group]));
1206+
if ( MPI_DATATYPE_NULL != newType ) {
1207+
ompi_datatype_destroy(&newType);
1208+
}
12031209
if (OMPI_SUCCESS != ret){
12041210
goto exit;
12051211
}
12061212
}
1207-
if ( MPI_DATATYPE_NULL != newType ) {
1208-
ompi_datatype_destroy(&newType);
1209-
}
1210-
1211-
free(blocklength_proc);
1212-
free(displs_proc);
12131213
}
12141214

12151215

@@ -1288,6 +1288,8 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i
12881288
free(sorted_file_offsets);
12891289
free(file_offsets_for_agg);
12901290
free(memory_displacements);
1291+
free(blocklength_proc);
1292+
free(displs_proc);
12911293

12921294
return OMPI_SUCCESS;
12931295
}

0 commit comments

Comments
 (0)