[spice-gtk v1 02/10] test-file-transfer: Don't leak GError

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christophe Fergeau <cfergeau@xxxxxxxxxx>

---
 tests/file-transfer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/file-transfer.c b/tests/file-transfer.c
index 4e00e9a..a27b9cf 100644
--- a/tests/file-transfer.c
+++ b/tests/file-transfer.c
@@ -152,6 +152,7 @@ transfer_cancelled_on_init_async_cb(GObject *obj, GAsyncResult *res, gpointer da
     info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
     g_assert_error(error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
     g_assert_null(info);
+    g_clear_error(&error);
 
     transfer_xfer_task_on_finished(NULL, NULL, data);
 }
@@ -208,6 +209,7 @@ transfer_cancelled_read_async_cb(GObject *source_object,
     count = spice_file_transfer_task_read_finish(xfer_task, res, &buffer, &error);
     g_assert_error(error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
     g_assert_cmpint(count, ==, -1);
+    g_clear_error(&error);
 
     transfer_xfer_task_on_finished(NULL, NULL, user_data);
 }
@@ -300,6 +302,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);
 }
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]