summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2016-07-27 12:51:56 +0200
committerVictor Toso <victortoso@redhat.com>2016-08-03 15:27:24 +0200
commit66d8e2ee5070a1f1a629f9948d046dea21fb3601 (patch)
tree4b615cbcd1e293c4bc0bb9be9a7e88e6025c1ee2 /tests
parent3a91bcfffabfda7667fc560fdc0ac0f2951d0152 (diff)
test-file-transfer: Don't leak GFileInfo
The GFileInfo returned by spice_file_transfer_task_init_task_finish() must be unref'ed when no longer needed. Acked-by: Victor Toso <victortoso@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/file-transfer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/file-transfer.c b/tests/file-transfer.c
index d4d216d..4e00e9a 100644
--- a/tests/file-transfer.c
+++ b/tests/file-transfer.c
@@ -116,6 +116,7 @@ transfer_init_async_cb(GObject *obj, GAsyncResult *res, gpointer data)
info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
g_assert_no_error(error);
g_assert_nonnull(info);
+ g_object_unref(info);
/* read file loop */
spice_file_transfer_task_read_async(xfer_task, transfer_read_async_cb, NULL);
@@ -223,6 +224,7 @@ transfer_on_init_async_cb_before_read_cancel(GObject *obj, GAsyncResult *res, gp
info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
g_assert_no_error(error);
g_assert_nonnull(info);
+ g_object_unref(info);
cancellable = spice_file_transfer_task_get_cancellable(xfer_task);
g_cancellable_cancel(cancellable);
@@ -241,6 +243,7 @@ transfer_on_init_async_cb_after_read_cancel(GObject *obj, GAsyncResult *res, gpo
info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
g_assert_no_error(error);
g_assert_nonnull(info);
+ g_object_unref(info);
cancellable = spice_file_transfer_task_get_cancellable(xfer_task);
spice_file_transfer_task_read_async(xfer_task, transfer_cancelled_read_async_cb, data);
@@ -313,6 +316,7 @@ transfer_on_init_async_cb_agent_cancel(GObject *obj, GAsyncResult *res, gpointer
info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
g_assert_no_error(error);
g_assert_nonnull(info);
+ g_object_unref(info);
spice_file_transfer_task_read_async(xfer_task, transfer_agent_cancelled_read_async_cb, data);