[libsoup/cache] soup-cache: only close the stream if we ever managed to open one



commit c2f5020c71cad4c826288ae755c200d1fdf7d174
Author: Xan Lopez <xan gnome org>
Date:   Fri Jul 31 22:47:38 2009 +0300

    soup-cache: only close the stream if we ever managed to open one

 libsoup/soup-cache.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/libsoup/soup-cache.c b/libsoup/soup-cache.c
index eccb4a5..976bef1 100644
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -472,11 +472,12 @@ msg_got_body_cb (SoupMessage *msg, SoupCacheEntry *entry)
 		return;
 	}
 
-	g_output_stream_close_async (entry->stream,
-				     G_PRIORITY_DEFAULT,
-				     NULL,
-				     (GAsyncReadyCallback)close_ready_cb,
-				     entry);
+	if (entry->stream)
+		g_output_stream_close_async (entry->stream,
+					     G_PRIORITY_DEFAULT,
+					     NULL,
+					     (GAsyncReadyCallback)close_ready_cb,
+					     entry);
 }
 
 static void



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