Handle allocator failure in EventNode constructor

This commit is contained in:
Vftdan 2024-08-19 21:05:16 +02:00
parent 7e4e56d8e2
commit 95354cbf95
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ EventNode *
event_create(const EventData * content)
{
EventNode * event = T_ALLOC(1, EventNode);
if (!event) {
return NULL;
}
if (content) {
event->data = *content;
event->data.modifiers = modifier_set_copy(content->modifiers);