From f38b27e92311df0d82e744487af5bb1ddbf7bb1a Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sun, 24 Feb 2019 14:48:54 +0100 Subject: [PATCH] Add check for NULL after malloc() --- glfw/linux_notify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glfw/linux_notify.c b/glfw/linux_notify.c index ffbf410f3..e608cae39 100644 --- a/glfw/linux_notify.c +++ b/glfw/linux_notify.c @@ -72,6 +72,7 @@ glfw_dbus_send_user_notification(const char *app_name, const char* icon, const c added_signal_match = session_bus; } NotificationCreatedData *data = malloc(sizeof(NotificationCreatedData)); + if (!data) return 0; data->next_id = ++notification_id; data->callback = callback; data->data = user_data; if (!data->next_id) data->next_id = ++notification_id;