From 9f4e892308ef99eaf0153357f9940a7174473d06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Fri, 1 Jun 2018 17:20:17 +0200
Subject: [PATCH 07/15] libgdm: Don't leak connection on sync re-authentication
---
libgdm/gdm-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgdm/gdm-client.c b/libgdm/gdm-client.c
index 36292148c..335a040a2 100644
--- a/libgdm/gdm-client.c
+++ b/libgdm/gdm-client.c
@@ -577,61 +577,61 @@ gdm_client_get_connection (GdmClient *client,
return;
}
get_manager (client,
cancellable,
(GAsyncReadyCallback)
on_got_manager_for_opening_connection,
task);
}
/**
* gdm_client_open_reauthentication_channel_sync:
* @client: a #GdmClient
* @username: user to reauthenticate
* @cancellable: a #GCancellable
* @error: a #GError
*
* Gets a #GdmUserVerifier object that can be used to
* reauthenticate an already logged in user. Free with
* g_object_unref to close reauthentication channel.
*
* Returns: (transfer full): #GdmUserVerifier or %NULL if @username is not
* already logged in.
*/
GdmUserVerifier *
gdm_client_open_reauthentication_channel_sync (GdmClient *client,
const char *username,
GCancellable *cancellable,
GError **error)
{
- GDBusConnection *connection;
+ g_autoptr(GDBusConnection) connection = NULL;
g_autoptr(GdmManager) manager = NULL;
GdmUserVerifier *user_verifier = NULL;
gboolean ret;
char *address;
g_return_val_if_fail (GDM_IS_CLIENT (client), FALSE);
manager = gdm_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
"org.gnome.DisplayManager",
"/org/gnome/DisplayManager/Manager",
cancellable,
error);
if (manager == NULL) {
goto out;
}
ret = gdm_manager_call_open_reauthentication_channel_sync (manager,
username,
&address,
cancellable,
error);
if (!ret) {
goto out;
}
g_debug ("GdmClient: connecting to address: %s", client->priv->address);
--
2.26.2