From: Marc Hartmayer Date: Fri, 21 Sep 2018 13:02:02 +0000 (+0200) Subject: virdbus: Unref the D-Bus connection when closing X-Git-Tag: v4.8.0-rc1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eedf83ceca5ad74c593068dd845958f3b3f108fd;p=thirdparty%2Flibvirt.git virdbus: Unref the D-Bus connection when closing 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 Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: John Ferlan --- diff --git a/src/util/virdbus.c b/src/util/virdbus.c index 0aa0fc6ee0..49c8b3c1ea 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -144,6 +144,7 @@ void virDBusCloseSystemBus(void) { if (systembus && !sharedBus) { dbus_connection_close(systembus); + dbus_connection_unref(systembus); systembus = NULL; } }