]> xenbits.xensource.com Git - libvirt.git/commitdiff
virdbus: Unref the D-Bus connection when closing
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Fri, 21 Sep 2018 13:02:02 +0000 (15:02 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 25 Sep 2018 23:27:41 +0000 (19:27 -0400)
As documented at
https://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#ga2522ac5075dfe0a1535471f6e045e1ee
the creator of a non-shared D-Bus connection has to release the last
reference after closing for freeing.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/util/virdbus.c

index 0aa0fc6ee036353e385eac8b01a0a6b20ca7eec7..49c8b3c1ea82059d2d03220279f1d849b35f2b73 100644 (file)
@@ -144,6 +144,7 @@ void virDBusCloseSystemBus(void)
 {
     if (systembus && !sharedBus) {
         dbus_connection_close(systembus);
+        dbus_connection_unref(systembus);
         systembus = NULL;
     }
 }