[Spice-devel] [PATCH spice-gtk 10/15] channel-main: Don't call g_input_stream_close on a NULL stream

Hans de Goede hdegoede at redhat.com
Sat Mar 9 03:06:30 PST 2013


If we fail to open a file, task->file_stream will be NULL, so we should
not call g_input_stream_close on it (which file_xfer_failed does).

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/channel-main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index cd5b162..e3c8b41 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2656,7 +2656,8 @@ static void file_xfer_read_async_cb(GObject *obj, GAsyncResult *res, gpointer da
 
     task->file_stream = g_file_read_finish(file, res, &error);
     if (error) {
-        file_xfer_failed (task, error);
+        task->error = error;
+        file_xfer_close_cb(NULL, NULL, task);
         return;
     }
 
-- 
1.8.1.4



More information about the Spice-devel mailing list