summaryrefslogtreecommitdiff
path: root/libgdm
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2018-06-01 17:22:20 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2018-06-02 20:20:09 +0200
commitd92f4d93ce2d5d25db5777459fcd51e2d80645a6 (patch)
tree72624bf7affa24a5b0fb9a2479755c867b12a650 /libgdm
parent1f5678c65c96d2534a687a2344fdc0655a832c47 (diff)
downloadgdm-d92f4d93ce2d5d25db5777459fcd51e2d80645a6.tar.gz
libgdm: Use auto-pointers and cleanup code
Diffstat (limited to 'libgdm')
-rw-r--r--libgdm/gdm-client.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libgdm/gdm-client.c b/libgdm/gdm-client.c
index 335a040a..7b42b6c9 100644
--- a/libgdm/gdm-client.c
+++ b/libgdm/gdm-client.c
@@ -606,9 +606,9 @@ gdm_client_open_reauthentication_channel_sync (GdmClient *client,
{
g_autoptr(GDBusConnection) connection = NULL;
g_autoptr(GdmManager) manager = NULL;
+ g_autofree char *address = NULL;
GdmUserVerifier *user_verifier = NULL;
gboolean ret;
- char *address;
g_return_val_if_fail (GDM_IS_CLIENT (client), FALSE);
@@ -620,7 +620,7 @@ gdm_client_open_reauthentication_channel_sync (GdmClient *client,
error);
if (manager == NULL) {
- goto out;
+ return NULL;
}
ret = gdm_manager_call_open_reauthentication_channel_sync (manager,
@@ -630,10 +630,10 @@ gdm_client_open_reauthentication_channel_sync (GdmClient *client,
error);
if (!ret) {
- goto out;
+ return NULL;
}
- g_debug ("GdmClient: connecting to address: %s", client->priv->address);
+ g_debug ("GdmClient: connecting to address: %s", address);
connection = g_dbus_connection_new_for_address_sync (address,
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
@@ -642,10 +642,8 @@ gdm_client_open_reauthentication_channel_sync (GdmClient *client,
error);
if (connection == NULL) {
- g_free (address);
- goto out;
+ return NULL;
}
- g_free (address);
user_verifier = gdm_user_verifier_proxy_new_sync (connection,
G_DBUS_PROXY_FLAGS_NONE,
@@ -654,7 +652,6 @@ gdm_client_open_reauthentication_channel_sync (GdmClient *client,
cancellable,
error);
- out:
return user_verifier;
}