[Spice-devel] [spice-gtk v2 2/9] test-file-transfer: Don't leak GError

Victor Toso victortoso at redhat.com
Tue Aug 2 09:48:43 UTC 2016


From: Christophe Fergeau <cfergeau at redhat.com>

---
 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



More information about the Spice-devel mailing list