summaryrefslogtreecommitdiffstats
path: root/bus/dispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r--bus/dispatch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 639b9509..b4b03d96 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -365,7 +365,12 @@ bus_dispatch_add_connection (DBusConnection *connection)
return FALSE;
handler = dbus_message_handler_new (bus_dispatch_message_handler, NULL, NULL);
-
+ if (handler == NULL)
+ {
+ message_handler_slot_unref ();
+ return FALSE;
+ }
+
if (!dbus_connection_add_filter (connection, handler))
{
dbus_message_handler_unref (handler);