From: Marcel Holtmann Date: Wed, 17 Dec 2008 15:01:42 +0000 (+0100) Subject: Handle failure of device registration X-Git-Tag: 0.5~6 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=8a903a3696cc93c7828bea9f098896ca9c410418;p=connman Handle failure of device registration --- diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 8c83a98..6b0f05c 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -243,7 +243,11 @@ static void add_adapter(DBusConnection *connection, const char *path) device->name = g_path_get_basename(path); - connman_element_register(device, NULL); + if (connman_element_register(device, NULL) < 0) { + connman_element_unref(device); + return; + } + device_list = g_slist_append(device_list, device); message = dbus_message_new_method_call(BLUEZ_SERVICE, path,