diff --git a/src/dbus.c b/src/dbus.c index baa37c9..2d0f53c 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -296,9 +296,6 @@ static void on_notify(GDBusConnection * connection, } notification *n = notification_create(); - if(n == NULL) { - die("Unable to allocate memory", EXIT_FAILURE); - } n->appname = appname; n->summary = summary; n->body = body; diff --git a/src/dunst.c b/src/dunst.c index 7109064..241524c 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -344,9 +344,6 @@ int dunst_main(int argc, char *argv[]) if (settings.startup_notification) { notification *n = notification_create(); - if(n == NULL) { - die("Unable to allocate memory", EXIT_FAILURE); - } n->appname = strdup("dunst"); n->summary = strdup("startup"); n->body = strdup("dunst is up and running"); diff --git a/src/notification.c b/src/notification.c index b3c956f..a1e68ec 100644 --- a/src/notification.c +++ b/src/notification.c @@ -321,6 +321,7 @@ char *notification_extract_markup_urls(char **str_ptr) { notification *notification_create(void) { notification *n = malloc(sizeof(notification)); + if(n == NULL) die("Unable to allocate memory", EXIT_FAILURE); memset(n, 0, sizeof(notification)); return n; }