[Xfce4-commits] <midori:master> Plug two filename leaks in the web cache

Christian Dywan noreply at xfce.org
Tue Oct 27 02:06:02 CET 2009


Updating branch refs/heads/master
         to 0eec63762f8c2190ee9c1cfdc4cc68f6eb8e0dc2 (commit)
       from aff65928b371c3794a78a2de6c2759076e29ef2f (commit)

commit 0eec63762f8c2190ee9c1cfdc4cc68f6eb8e0dc2
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Oct 26 23:46:21 2009 +0100

    Plug two filename leaks in the web cache

 extensions/web-cache.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/extensions/web-cache.c b/extensions/web-cache.c
index e36bc40..425ea6b 100644
--- a/extensions/web-cache.c
+++ b/extensions/web-cache.c
@@ -133,6 +133,8 @@ web_cache_save_headers (SoupMessage* msg,
       while (soup_message_headers_iter_next (&iter, &name, &value))
           g_fprintf (dscfd, "%s: %s\n", name, value);
       fclose (dscfd);
+
+      g_free (dsc_filename);
 }
 
 GHashTable*
@@ -271,6 +273,7 @@ web_cache_mesage_got_headers_cb (SoupMessage*     msg,
                                   G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
         {
             g_free (uri);
+            g_free (filename);
             return;
         }
     }
@@ -281,17 +284,17 @@ web_cache_mesage_got_headers_cb (SoupMessage*     msg,
         g_signal_handlers_disconnect_by_func (msg,
             web_cache_mesage_got_headers_cb, extension);
         web_cache_message_rewrite (msg, filename);
+        g_free (filename);
     }
     else if (msg->status_code == SOUP_STATUS_OK)
     {
         /* g_debug ("updating cache: %s -> %s", uri, filename); */
         web_cache_save_headers (msg, filename);
         /* FIXME: Do we need to disconnect signal after we are in unqueue? */
-        g_signal_connect (msg, "got-chunk",
-            G_CALLBACK (web_cache_message_got_chunk_cb), filename);
+        g_signal_connect_data (msg, "got-chunk",
+            G_CALLBACK (web_cache_message_got_chunk_cb),
+            filename, (GClosureNotify)g_free, 0);
     }
-    /* FIXME: how to free this?
-      g_free (filename); */
     g_free (uri);
 }
 



More information about the Xfce4-commits mailing list