diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-07-27 12:51:56 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-07-27 18:18:16 +0200 |
commit | 762ba4be726c201fe3321c76171190be26e63b83 (patch) | |
tree | ddbb89fa8f05b69f35633cc2d01583e28ee50ef5 | |
parent | 12486631da6bb43fe5f3d008f6ab38055708e792 (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.
-rw-r--r-- | tests/file-transfer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/file-transfer.c b/tests/file-transfer.c index b94614e..da20491 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); @@ -297,6 +300,7 @@ transfer_agent_cancelled_read_async_cb(GObject *source_object, count = spice_file_transfer_task_read_finish(xfer_task, res, &buffer, &error); g_assert_error(error, SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED); g_assert_cmpint(count, ==, -1); + g_clear_error(&error); transfer_xfer_task_on_finished(NULL, NULL, user_data); } @@ -312,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); |