manager: Fix removing adapter from list upon initialization failure

This commit is contained in:
Johan Hedberg 2012-01-02 13:34:03 +02:00
parent ec60f0ad0d
commit deada67640

View File

@ -395,6 +395,7 @@ struct btd_adapter *btd_manager_register_adapter(int id)
adapters = g_slist_append(adapters, adapter);
if (!adapter_init(adapter)) {
adapters = g_slist_remove(adapters, adapter);
btd_adapter_unref(adapter);
return NULL;
}