summaryrefslogtreecommitdiff
path: root/tests/src/libsystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/libsystem.c')
-rw-r--r--tests/src/libsystem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index 5cbf203f..6685f5d4 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -1376,7 +1376,6 @@ xcb_connect_to_display_with_auth_info (const char *display, xcb_auth_info_t *aut
{
xcb_connection_t *c;
gchar *socket_path;
- GSocketAddress *address;
GError *error = NULL;
c = malloc (sizeof (xcb_connection_t));
@@ -1401,6 +1400,7 @@ xcb_connect_to_display_with_auth_info (const char *display, xcb_auth_info_t *aut
if (c->error == 0)
{
gchar *d;
+ GSocketAddress *address;
/* Skip the hostname, we'll assume it's localhost */
d = g_strdup_printf (".x%s", strchr (display, ':'));
@@ -1410,6 +1410,7 @@ xcb_connect_to_display_with_auth_info (const char *display, xcb_auth_info_t *aut
address = g_unix_socket_address_new (socket_path);
if (!g_socket_connect (c->socket, address, NULL, &error))
c->error = XCB_CONN_ERROR;
+ g_object_unref (address);
if (error)
g_printerr ("Failed to connect to X socket %s: %s\n", socket_path, error->message);
g_free (socket_path);
@@ -1421,8 +1422,6 @@ xcb_connect_to_display_with_auth_info (const char *display, xcb_auth_info_t *aut
{
}
- g_object_unref (address);
-
return c;
}