summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2021-10-15 16:33:12 -0500
committerMichael Catanzaro <mcatanzaro@redhat.com>2021-10-16 07:15:51 -0500
commited348e4b25c224b38a8f5eb5ced2044ffa66e898 (patch)
treec3ee61858e1fd13a3f9575e15af7edfa5ee1de9a
parent7143d3292207e96aad53a145578137f2bd6a2b0c (diff)
downloadepiphany-ed348e4b25c224b38a8f5eb5ced2044ffa66e898.tar.gz
Fix some user content and user scripts leaks
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1020>
-rw-r--r--embed/ephy-web-view.c6
-rw-r--r--src/webextension/ephy-web-extension-manager.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index d107c153c..44b1786ba 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -4153,7 +4153,7 @@ ephy_web_view_class_init (EphyWebViewClass *klass)
static void
ephy_web_view_ucm_add_custom_scripts (WebKitUserContentManager *ucm)
{
- WebKitUserScript *script;
+ g_autoptr (WebKitUserScript) script = NULL;
g_autoptr (GBytes) youtube_js = NULL;
g_auto (GStrv) allow_list = NULL;
g_autoptr (GError) error = NULL;
@@ -4188,7 +4188,7 @@ GtkWidget *
ephy_web_view_new (void)
{
EphyEmbedShell *shell = ephy_embed_shell_get_default ();
- WebKitUserContentManager *ucm = webkit_user_content_manager_new ();
+ g_autoptr (WebKitUserContentManager) ucm = webkit_user_content_manager_new ();
ephy_embed_shell_register_ucm_handler (shell, ucm);
ephy_embed_prefs_register_ucm (ucm);
@@ -4207,7 +4207,7 @@ GtkWidget *
ephy_web_view_new_with_related_view (WebKitWebView *related_view)
{
EphyEmbedShell *shell = ephy_embed_shell_get_default ();
- WebKitUserContentManager *ucm = webkit_user_content_manager_new ();
+ g_autoptr (WebKitUserContentManager) ucm = webkit_user_content_manager_new ();
ephy_web_view_ucm_add_custom_scripts (ucm);
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index 4cf80a6b6..3ff9ca32d 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -620,7 +620,7 @@ static GtkWidget *
create_web_extensions_webview (EphyWebExtension *web_extension,
gboolean custom_web_context)
{
- WebKitUserContentManager *ucm;
+ g_autoptr (WebKitUserContentManager) ucm = NULL;
WebKitWebContext *web_context;
WebKitSettings *settings;
GtkWidget *web_view;