From 8318672fe99773b0009cf68d291ce1f535309565 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 8 Sep 2015 18:12:28 +0200 Subject: core: fix file descriptor leak in bus manager There's a bug [1] in GLib for which a GDBusConnection is marked as closed when the remote peer vanishes but its resources are not cleaned up. Work around the issue by explicitly closing the connection when remote_peer_vanished is TRUE. [1] https://bugzilla.gnome.org/show_bug.cgi?id=754730 https://bugzilla.redhat.com/show_bug.cgi?id=1260920 --- src/nm-bus-manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nm-bus-manager.c b/src/nm-bus-manager.c index 5f528a6f0e..57d77aae48 100644 --- a/src/nm-bus-manager.c +++ b/src/nm-bus-manager.c @@ -131,6 +131,13 @@ private_server_closed (GDBusConnection *conn, s->detail, conn); + /* FIXME: there's a bug (754730) in GLib for which the connection + * is marked as closed when the remote peer vanishes but its + * resources are not cleaned up. Work around it by explicitly + * closing the connection in that case. */ + if (remote_peer_vanished) + g_dbus_connection_close (conn, NULL, NULL, NULL); + g_hash_table_remove (s->connections, conn); } -- cgit v1.2.1