soup-cache: plug leak
authorXan Lopez <xlopez@igalia.com>
Sat, 23 Apr 2011 19:40:55 +0000 (12:40 -0700)
committerXan Lopez <xlopez@igalia.com>
Mon, 25 Apr 2011 17:04:25 +0000 (10:04 -0700)
We are leaking a GFile per cache response.

https://bugzilla.gnome.org/show_bug.cgi?id=648521

libsoup/soup-cache.c

index 4812f46..5b64575 100644 (file)
@@ -1035,7 +1035,8 @@ soup_cache_send_response (SoupCache *cache, SoupMessage *msg)
           were the file was no longer there (for example files
           removed without notifying the cache */
        file = g_file_new_for_path (entry->filename);
-       stream = (GInputStream *)g_file_read (file, NULL, NULL);
+       stream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
+       g_object_unref (file);
 
        return stream;
 }