Decrements the reference count of session_bus 31/135531/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 23 Jun 2017 02:37:02 +0000 (11:37 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Fri, 23 Jun 2017 02:41:07 +0000 (11:41 +0900)
dbus_bus_get increments reference count of a DBusConnection.
It is callers responsibility to all dbus_connection_unref after use.

[Gnome]
https://bugzilla.gnome.org/show_bug.cgi?id=784120

Change-Id: Ic1b23755fa9a2a46aaa2ad970254063a5486f8f6

atspi/atspi-misc.c

index 48759ca..679e0da 100644 (file)
@@ -1497,7 +1497,7 @@ get_accessibility_bus_address_dbus (void)
     g_warning ("Error retrieving accessibility bus address: %s: %s",
                error.name, error.message);
     dbus_error_free (&error);
-    return NULL;
+    goto out;
   }
   
   {
@@ -1509,12 +1509,14 @@ get_accessibility_bus_address_dbus (void)
                                DBUS_TYPE_INVALID))
       {
        dbus_message_unref (reply);
-       return NULL;
+        goto out;
       }
     address = g_strdup (tmp_address);
     dbus_message_unref (reply);
   }
-  
+
+out:
+  dbus_connection_unref (session_bus);
   return address;
 }