Correct memory handling leading to corruption in adblock

This commit is contained in:
Christian Dywan 2009-10-03 02:03:49 +02:00
parent ec81068299
commit 2b493414d5

View file

@ -74,6 +74,7 @@ adblock_download_notify_status_cb (WebKitDownload* download,
gchar* path) gchar* path)
{ {
pattern = adblock_parse_file (path); pattern = adblock_parse_file (path);
g_free (path);
/* g_object_unref (download); */ /* g_object_unref (download); */
} }
@ -114,8 +115,10 @@ adblock_reload_rules(MidoriExtension* extension)
webkit_download_start (download); webkit_download_start (download);
} }
else else
{
pattern = adblock_parse_file (path); pattern = adblock_parse_file (path);
g_free (path); g_free (path);
}
g_free (filename); g_free (filename);
} }
g_strfreev (filters); g_strfreev (filters);
@ -160,11 +163,13 @@ adblock_preferences_model_row_changed_cb (GtkTreeModel* model,
filters[i++] = filter; filters[i++] = filter;
need_reload = TRUE; need_reload = TRUE;
} }
else
g_free (filter); g_free (filter);
} }
while (gtk_tree_model_iter_next (model, iter)); while (gtk_tree_model_iter_next (model, iter));
filters[length] = NULL; filters[length] = NULL;
midori_extension_set_string_list (extension, "filters", filters, length); midori_extension_set_string_list (extension, "filters", filters, length);
g_strfreev (filters);
if (need_reload) if (need_reload)
adblock_reload_rules (extension); adblock_reload_rules (extension);
} }