summaryrefslogtreecommitdiff
path: root/src/plugins.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-03-23 15:36:18 +0100
committerportix <portix@gmx.net>2011-03-23 15:36:18 +0100
commited627dbbdf140fa0f7c4e0bd1ca3e1aa6796d420 (patch)
tree5c65d2be420b78833faaefce0f596594424a8f6b /src/plugins.c
parentabccef8e803ce063569c5ca74412b536e4cffb88 (diff)
downloaddwb-ed627dbbdf140fa0f7c4e0bd1ca3e1aa6796d420.zip
Changed pointer for plugin-blocker, fixed memory leak, Nullterminated strings in 'dwb_execute_script'
Diffstat (limited to 'src/plugins.c')
-rw-r--r--src/plugins.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins.c b/src/plugins.c
index 60efb87d..7484a5ae 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -9,20 +9,18 @@ GtkWidget *
dwb_plugins_create_cb(WebKitWebView *wv, char *mimetype, char *uri, GHashTable *param, GList *gl) {
GtkWidget *ret = NULL;
if (!strcmp(mimetype, "application/x-shockwave-flash")) {
+ char *value = NULL, *id, *command;
GString *string = g_string_new(NULL);
g_hash_table_foreach(param, (GHFunc)dwb_plugins_get_embed_values, &string);
- char *id = g_hash_table_lookup(param, "id");
- char *command = g_strdup_printf("DwbPlugin.remove('%s', '%s')", id, string->str);
+ id = g_hash_table_lookup(param, "id");
+ command = g_strdup_printf("DwbPlugin.remove('%s', '%s', '%s')", id, string->str, mimetype);
g_string_free(string, true);
- char *value;
dwb_execute_script(wv, command, &value);
g_free(command);
- if (value && !strcmp(value, "__dwb__blocked__")) {
- g_free(value);
- }
- else {
+ if (!value || strcmp(value, "__dwb__blocked__")) {
ret = gtk_event_box_new();
}
+ FREE(value);
}
return ret;
}