[Xfce4-commits] <midori:master> Correct memory handling leading to corruption in adblock

Christian Dywan noreply at xfce.org
Sat Oct 3 02:34:01 CEST 2009


Updating branch refs/heads/master
         to 2b493414d5b096c2f25009d9af471ba4b42177d1 (commit)
       from ec810682999df35032d665b8010f846d841d8c6f (commit)

commit 2b493414d5b096c2f25009d9af471ba4b42177d1
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Oct 3 02:03:49 2009 +0200

    Correct memory handling leading to corruption in adblock

 extensions/adblock.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/extensions/adblock.c b/extensions/adblock.c
index 03e2a0b..9def25a 100644
--- a/extensions/adblock.c
+++ b/extensions/adblock.c
@@ -74,11 +74,12 @@ adblock_download_notify_status_cb (WebKitDownload* download,
                                    gchar*          path)
 {
     pattern = adblock_parse_file (path);
+    g_free (path);
     /* g_object_unref (download); */
 }
 
 static void
-adblock_reload_rules(MidoriExtension* extension)
+adblock_reload_rules (MidoriExtension* extension)
 {
     gchar** filters;
     gchar* folder;
@@ -114,8 +115,10 @@ adblock_reload_rules(MidoriExtension* extension)
             webkit_download_start (download);
         }
         else
+        {
             pattern = adblock_parse_file (path);
-        g_free (path);
+            g_free (path);
+        }
         g_free (filename);
     }
     g_strfreev (filters);
@@ -160,11 +163,13 @@ adblock_preferences_model_row_changed_cb (GtkTreeModel*    model,
                 filters[i++] = filter;
                 need_reload = TRUE;
             }
-            g_free (filter);
+            else
+                g_free (filter);
         }
         while (gtk_tree_model_iter_next (model, iter));
     filters[length] = NULL;
     midori_extension_set_string_list (extension, "filters", filters, length);
+    g_strfreev (filters);
     if (need_reload)
         adblock_reload_rules (extension);
 }



More information about the Xfce4-commits mailing list