[PATCH spice-gtk 03/16] channel-main: Call g_simple_async_result_is_valid first

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

 



Call g_simple_async_result_is_valid before using the result.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 gtk/channel-main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 257ded5..5f981c4 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -866,17 +866,15 @@ static void file_xfer_flush_async(SpiceMainChannel *channel, GCancellable *cance
 static gboolean file_xfer_flush_finish(SpiceMainChannel *channel, GAsyncResult *result,
                                        GError **error)
 {
-    GSimpleAsyncResult *simple;
+    GSimpleAsyncResult *simple = (GSimpleAsyncResult *)result;
 
-    simple = (GSimpleAsyncResult *)result;
+    g_return_val_if_fail(g_simple_async_result_is_valid(result,
+        G_OBJECT(channel), file_xfer_flush_async), FALSE);
 
     if (g_simple_async_result_propagate_error(simple, error)) {
         return FALSE;
     }
 
-    g_return_val_if_fail(g_simple_async_result_is_valid(result,
-        G_OBJECT(channel), file_xfer_flush_async), FALSE);
-
     CHANNEL_DEBUG(channel, "flushed finished!");
     return g_simple_async_result_get_op_res_gboolean(simple);
 }
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]