diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2013-09-05 17:38:10 +1200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2013-09-05 17:38:10 +1200 |
commit | 70bfeb199fba53cfabbdc706d0e3c3f94187d155 (patch) | |
tree | cf839bc39e5a7969b97dd016d981c5639873d44b /tests | |
parent | dbd0ad77a8c4c672639d574c261454600aaafb8f (diff) | |
download | lightdm-70bfeb199fba53cfabbdc706d0e3c3f94187d155.tar.gz |
Don't unref unassigned variable
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/libsystem.c | 5 |
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; } |