Decrements the reference count of session_bus
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 23 Jun 2017 02:02:47 +0000 (11:02 +0900)
committerMike Gorse <mgorse@suse.com>
Sun, 23 Jul 2017 17:59:45 +0000 (12:59 -0500)
dbus_bus_get increments reference count of a DBusConnection.
It is callers responsibility to all dbus_connection_unref after use.

atspi/atspi-misc.c

index 89fe9e7..46d1c11 100644 (file)
@@ -1533,7 +1533,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;
   }
   
   {
@@ -1545,12 +1545,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;
 }