diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-08-04 13:13:24 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-08-05 14:46:09 +0100 |
commit | 9f64c1930a076d4601cf74d69e1d98465cc0c1bc (patch) | |
tree | 606421bf5512b5d0244e2a24718916b8cb733129 | |
parent | 20e2dc7c74cd1e1232db56e4655de264d17aae6f (diff) | |
download | dbus-9f64c1930a076d4601cf74d69e1d98465cc0c1bc.tar.gz |
relay test: don't leak the server's address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r-- | test/relay.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/relay.c b/test/relay.c index bad39f47..f4129d0a 100644 --- a/test/relay.c +++ b/test/relay.c @@ -137,12 +137,15 @@ test_connect (Fixture *f, gconstpointer data G_GNUC_UNUSED) { dbus_bool_t have_mem; + char *address; g_assert (f->left_server_conn == NULL); g_assert (f->right_server_conn == NULL); - f->left_client_conn = dbus_connection_open_private ( - dbus_server_get_address (f->server), &f->e); + address = dbus_server_get_address (f->server); + g_assert (address != NULL); + + f->left_client_conn = dbus_connection_open_private (address, &f->e); assert_no_error (&f->e); g_assert (f->left_client_conn != NULL); dbus_connection_setup_with_g_main (f->left_client_conn, NULL); @@ -153,12 +156,13 @@ test_connect (Fixture *f, g_main_context_iteration (NULL, TRUE); } - f->right_client_conn = dbus_connection_open_private ( - dbus_server_get_address (f->server), &f->e); + f->right_client_conn = dbus_connection_open_private (address, &f->e); assert_no_error (&f->e); g_assert (f->right_client_conn != NULL); dbus_connection_setup_with_g_main (f->right_client_conn, NULL); + dbus_free (address); + while (f->right_server_conn == NULL) { g_print ("."); |