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 3a8229f..197e8e0 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