mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-05-03 11:50:59 -04:00
event_create(): check malloc() to be non-NULL
Check malloc() to return non-NULL before writing data in the function event_create(). Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
parent
5a0898288d
commit
94e73f6f0c
|
@ -43,9 +43,12 @@ struct event * event_create( void )
|
|||
{
|
||||
struct event * ev = malloc( sizeof( struct event ) );
|
||||
|
||||
if( ev )
|
||||
{
|
||||
ev->event_triggered = false;
|
||||
pthread_mutex_init( &ev->mutex, NULL );
|
||||
pthread_cond_init( &ev->cond, NULL );
|
||||
}
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue