[epiphany/mcatanzaro/leaks] Fix some user content and user scripts leaks




commit d99413c42ae5f66e89281bbd3bc4813e59a35152
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Oct 15 16:33:12 2021 -0500

    Fix some user content and user scripts leaks
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1020>

 embed/ephy-web-view.c                         | 6 +++---
 src/webextension/ephy-web-extension-manager.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index f53a6a734..0c9eccee3 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -4282,7 +4282,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;
@@ -4317,7 +4317,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);
@@ -4336,7 +4336,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]