mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 05:34:23 +08:00
Network: Missing DBusConnection unref
This commit is contained in:
parent
9ab6fa037c
commit
6299ff3c17
@ -32,16 +32,17 @@
|
||||
#include "plugin.h"
|
||||
#include "manager.h"
|
||||
|
||||
static DBusConnection *connection = NULL;
|
||||
|
||||
static int network_init(void)
|
||||
{
|
||||
DBusConnection *conn;
|
||||
|
||||
conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
|
||||
if (conn == NULL)
|
||||
connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
|
||||
if (connection == NULL)
|
||||
return -EIO;
|
||||
|
||||
if (network_manager_init(conn) < 0) {
|
||||
dbus_connection_unref(conn);
|
||||
if (network_manager_init(connection) < 0) {
|
||||
dbus_connection_unref(connection);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@ -51,6 +52,7 @@ static int network_init(void)
|
||||
static void network_exit(void)
|
||||
{
|
||||
network_manager_exit();
|
||||
dbus_connection_unref(connection);
|
||||
}
|
||||
|
||||
BLUETOOTH_PLUGIN_DEFINE("network", network_init, network_exit)
|
||||
|
Loading…
Reference in New Issue
Block a user