From cba502370b9cb7a1c4d15d0b05ff9cc5082bac67 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Fri, 7 Jun 2024 08:04:13 +0000 Subject: [PATCH] Code review suggestion Signed-off-by: Gaurav Aggarwal --- portable/ThirdParty/GCC/Posix/utils/wait_for_event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c b/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c index 40a428df0d2..bf744e27f37 100644 --- a/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c +++ b/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c @@ -43,12 +43,13 @@ struct event * event_create( void ) { struct event * ev = malloc( sizeof( struct event ) ); - if( ev ) + if( ev != NULL ) { ev->event_triggered = false; pthread_mutex_init( &ev->mutex, NULL ); pthread_cond_init( &ev->cond, NULL ); } + return ev; }