Handle allocator failure in EventNode constructor
This commit is contained in:
parent
7e4e56d8e2
commit
95354cbf95
3
events.c
3
events.c
|
@ -35,6 +35,9 @@ EventNode *
|
||||||
event_create(const EventData * content)
|
event_create(const EventData * content)
|
||||||
{
|
{
|
||||||
EventNode * event = T_ALLOC(1, EventNode);
|
EventNode * event = T_ALLOC(1, EventNode);
|
||||||
|
if (!event) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (content) {
|
if (content) {
|
||||||
event->data = *content;
|
event->data = *content;
|
||||||
event->data.modifiers = modifier_set_copy(content->modifiers);
|
event->data.modifiers = modifier_set_copy(content->modifiers);
|
||||||
|
|
Loading…
Reference in New Issue