[Spice-devel] [PATCH spice-gtk 13/16] channel-main: Don't call g_input_stream_close on a NULL stream
Hans de Goede
hdegoede at redhat.com
Fri Mar 29 04:40:25 PDT 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.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
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
More information about the Spice-devel
mailing list