Skip to content

Commit b8d45a2

Browse files
committed
fbtl/posix: fix for CID 1645300
initialize all elements of the aio structure to zero by using calloc instead of malloc Signed-off-by: Edgar Gabriel <[email protected]>
1 parent b7b0a4f commit b8d45a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/fbtl/posix/fbtl_posix_ipwritev.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ ssize_t mca_fbtl_posix_ipwritev (ompio_file_t *fh,
5555
data->prd_req_type = FBTL_POSIX_AIO_WRITE;
5656
data->prd_req_chunks = ompi_fbtl_posix_max_prd_active_reqs;
5757
data->prd_total_len = 0;
58-
data->prd_aio.aio_reqs = (struct aiocb *) malloc (sizeof(struct aiocb) *
59-
fh->f_num_of_io_entries);
58+
data->prd_aio.aio_reqs = (struct aiocb *) calloc (fh->f_num_of_io_entries,
59+
sizeof(struct aiocb));
6060
if (NULL == data->prd_aio.aio_reqs) {
6161
opal_output (1,"mca_fbtl_posix_ipwritev: could not allocate memory\n");
6262
free(data);

0 commit comments

Comments
 (0)