From 08670c9163a5d0f15c57c7891ef899eb125d9423 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 3 Oct 2013 16:44:19 +0200 Subject: bluez: fix leak of NMBluezDevice in bluez_connect_cb Signed-off-by: Thomas Haller --- src/bluez-manager/nm-bluez-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bluez-manager/nm-bluez-device.c b/src/bluez-manager/nm-bluez-device.c index 664c846d97..c333796527 100644 --- a/src/bluez-manager/nm-bluez-device.c +++ b/src/bluez-manager/nm-bluez-device.c @@ -470,7 +470,8 @@ bluez_connect_cb (GDBusConnection *dbus_connection, gpointer user_data) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); - NMBluezDevice *self = NM_BLUEZ_DEVICE (g_async_result_get_source_object (G_ASYNC_RESULT (result))); + GObject *result_object = g_async_result_get_source_object (G_ASYNC_RESULT (result)); + NMBluezDevice *self = NM_BLUEZ_DEVICE (result_object); NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); GError *error = NULL; char *device; @@ -492,6 +493,7 @@ bluez_connect_cb (GDBusConnection *dbus_connection, g_simple_async_result_complete (result); g_object_unref (result); + g_object_unref (result_object); } void -- cgit v1.2.1