mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Add check for NULL after malloc()
This commit is contained in:
1
glfw/linux_notify.c
vendored
1
glfw/linux_notify.c
vendored
@@ -72,6 +72,7 @@ glfw_dbus_send_user_notification(const char *app_name, const char* icon, const c
|
|||||||
added_signal_match = session_bus;
|
added_signal_match = session_bus;
|
||||||
}
|
}
|
||||||
NotificationCreatedData *data = malloc(sizeof(NotificationCreatedData));
|
NotificationCreatedData *data = malloc(sizeof(NotificationCreatedData));
|
||||||
|
if (!data) return 0;
|
||||||
data->next_id = ++notification_id;
|
data->next_id = ++notification_id;
|
||||||
data->callback = callback; data->data = user_data;
|
data->callback = callback; data->data = user_data;
|
||||||
if (!data->next_id) data->next_id = ++notification_id;
|
if (!data->next_id) data->next_id = ++notification_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user