summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-09-05 17:38:10 +1200
committerRobert Ancell <robert.ancell@canonical.com>2013-09-05 17:38:10 +1200
commit70bfeb199fba53cfabbdc706d0e3c3f94187d155 (patch)
treecf839bc39e5a7969b97dd016d981c5639873d44b
parentdbd0ad77a8c4c672639d574c261454600aaafb8f (diff)
downloadlightdm-70bfeb199fba53cfabbdc706d0e3c3f94187d155.tar.gz
Don't unref unassigned variable
-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;
}