Skip to content

Commit 01db258

Browse files
authored
Merge pull request #6702 from edgargabriel/topic/coverty-fixes-external32
common/ompio: fix coverty warnings
2 parents ad29f70 + 8eda9f2 commit 01db258

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ompi/mca/common/ompio/common_ompio_file_read.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
130130
if ( MPI_STATUS_IGNORE != status ) {
131131
status->_ucount = 0;
132132
}
133+
if (NULL != decoded_iov) {
134+
free (decoded_iov);
135+
decoded_iov = NULL;
136+
}
133137
return OMPI_SUCCESS;
134138
}
135139

@@ -309,6 +313,11 @@ int mca_common_ompio_file_iread (ompio_file_t *fh,
309313
ompio_req->req_ompi.req_status._ucount = 0;
310314
ompi_request_complete (&ompio_req->req_ompi, false);
311315
*request = (ompi_request_t *) ompio_req;
316+
if (NULL != decoded_iov) {
317+
free (decoded_iov);
318+
decoded_iov = NULL;
319+
}
320+
312321
return OMPI_SUCCESS;
313322
}
314323

ompi/mca/common/ompio/common_ompio_file_write.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ int mca_common_ompio_file_write (ompio_file_t *fh,
115115
if ( MPI_STATUS_IGNORE != status ) {
116116
status->_ucount = 0;
117117
}
118+
if (NULL != decoded_iov) {
119+
free (decoded_iov);
120+
decoded_iov = NULL;
121+
}
118122
return OMPI_SUCCESS;
119123
}
120124

@@ -288,6 +292,11 @@ int mca_common_ompio_file_iwrite (ompio_file_t *fh,
288292
ompio_req->req_ompi.req_status._ucount = 0;
289293
ompi_request_complete (&ompio_req->req_ompi, false);
290294
*request = (ompi_request_t *) ompio_req;
295+
if (NULL != decoded_iov) {
296+
free (decoded_iov);
297+
decoded_iov = NULL;
298+
}
299+
291300
return OMPI_SUCCESS;
292301
}
293302

0 commit comments

Comments
 (0)