Diff between 0aee0052346e97edcd9e0f511b3bcaf423791334 and bbcc0f34da62397a8e30d65d2eaa61bb05c160b6

Changed Files

File Additions Deletions Status
obexd/client/session.c +9 -0 modified
obexd/client/session.h +1 -0 modified

Full Patch

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 825bee7..c894526 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -200,6 +200,9 @@ static void session_free(struct session_data *session)
 	if (session->conn)
 		dbus_connection_unref(session->conn);
 
+	if (session->conn_system)
+		dbus_connection_unref(session->conn_system);
+
 	sessions = g_slist_remove(sessions, session);
 
 	g_free(session->callback);
@@ -564,6 +567,12 @@ struct session_data *session_create(const char *source,
 		return NULL;
 	}
 
+	session->conn_system = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);
+	if (session->conn_system == NULL) {
+		session_free(session);
+		return NULL;
+	}
+
 	if (source == NULL)
 		bacpy(&session->src, BDADDR_ANY);
 	else
diff --git a/obexd/client/session.h b/obexd/client/session.h
index 6f8a434..554b494 100644
--- a/obexd/client/session.h
+++ b/obexd/client/session.h
@@ -42,6 +42,7 @@ struct session_data {
 	uuid_t uuid;		/* Bluetooth Service Class */
 	gchar *path;		/* Session path */
 	DBusConnection *conn;
+	DBusConnection *conn_system; /* system bus connection */
 	DBusMessage *msg;
 	GwObex *obex;
 	GIOChannel *io;