mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-05 06:30:30 +01:00
test: Fix a couple of memory leaks in test-corrupt
Spotted while testing bug #100568. Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100568
This commit is contained in:
parent
9e864c2e4b
commit
bb43433b63
1 changed files with 6 additions and 2 deletions
|
|
@ -99,14 +99,16 @@ test_connect (Fixture *f,
|
|||
gconstpointer addr G_GNUC_UNUSED)
|
||||
{
|
||||
dbus_bool_t have_mem;
|
||||
char *address = NULL;
|
||||
|
||||
g_assert (f->server_conn == NULL);
|
||||
|
||||
f->client_conn = dbus_connection_open_private (
|
||||
dbus_server_get_address (f->server), &f->e);
|
||||
address = dbus_server_get_address (f->server);
|
||||
f->client_conn = dbus_connection_open_private (address, &f->e);
|
||||
assert_no_error (&f->e);
|
||||
g_assert (f->client_conn != NULL);
|
||||
test_connection_setup (f->ctx, f->client_conn);
|
||||
dbus_free (address);
|
||||
|
||||
while (f->server_conn == NULL)
|
||||
{
|
||||
|
|
@ -352,6 +354,7 @@ teardown (Fixture *f,
|
|||
{
|
||||
if (f->client_conn != NULL)
|
||||
{
|
||||
test_connection_shutdown (f->ctx, f->client_conn);
|
||||
dbus_connection_close (f->client_conn);
|
||||
dbus_connection_unref (f->client_conn);
|
||||
f->client_conn = NULL;
|
||||
|
|
@ -359,6 +362,7 @@ teardown (Fixture *f,
|
|||
|
||||
if (f->server_conn != NULL)
|
||||
{
|
||||
test_connection_shutdown (f->ctx, f->server_conn);
|
||||
dbus_connection_close (f->server_conn);
|
||||
dbus_connection_unref (f->server_conn);
|
||||
f->server_conn = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue