From de196e058692f0b70286e516af8e3683ea1c9d76 Mon Sep 17 00:00:00 2001 From: alessandronardin Date: Tue, 24 Sep 2024 18:52:25 +0200 Subject: [PATCH] posix/aio_misc.c: changed malloc call into calloc Coverity CID 1512510 Changed a call to malloc() into a call to calloc() to avoid access to uninitialized memory. Closes #5131. --- cpukit/posix/src/aio_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/posix/src/aio_misc.c b/cpukit/posix/src/aio_misc.c index 7536e650e3..5e4195f294 100644 --- a/cpukit/posix/src/aio_misc.c +++ b/cpukit/posix/src/aio_misc.c @@ -296,7 +296,7 @@ rtems_aio_request_chain *rtems_aio_search_fd( if ( create == 0 ) { r_chain = NULL; } else { - r_chain = malloc( sizeof( rtems_aio_request_chain ) ); + r_chain = calloc( 1, sizeof( rtems_aio_request_chain ) ); rtems_chain_initialize_empty( &r_chain->perfd ); rtems_chain_initialize_node( &r_chain->next_fd );