[PATCH spice-gtk 13/16] channel-main: Don't call g_input_stream_close on a NULL stream

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

 



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

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

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index c7ac12d..5a05651 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2591,6 +2591,11 @@ static void file_xfer_completed(SpiceFileXferTask *task, GError *error)
     if (task->pending)
         return;
 
+    if (!task->file_stream) {
+        file_xfer_close_cb(NULL, NULL, task);
+        return;
+    }
+
     g_input_stream_close_async(G_INPUT_STREAM(task->file_stream),
                                G_PRIORITY_DEFAULT,
                                task->cancellable,
-- 
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]