[epiphany] Fix memory leak in ephy_web_view_set_popups_allowed



commit 8b22ab4c219c08b1d4d46f59cf1b60316d5b2392
Author: LubomÃr SedlÃÅ <lubomir sedlar gmail com>
Date:   Sat May 12 15:41:55 2012 +0200

    Fix memory leak in ephy_web_view_set_popups_allowed
    
    If ephy_embed_shell_get_embed_single () does not return a correct
    manager, a location string is leaked.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675888

 embed/ephy-web-view.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 149ae62..61c1fe1 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -292,9 +292,6 @@ ephy_web_view_set_popups_allowed (EphyWebView *view,
   EphyPermissionManager *manager;
   EphyPermission permission;
 
-  location = ephy_web_view_get_location (view, TRUE);
-  g_return_if_fail (location != NULL);
-
   manager = EPHY_PERMISSION_MANAGER
             (ephy_embed_shell_get_embed_single (embed_shell));
   g_return_if_fail (EPHY_IS_PERMISSION_MANAGER (manager));
@@ -302,6 +299,9 @@ ephy_web_view_set_popups_allowed (EphyWebView *view,
   permission = allowed ? EPHY_PERMISSION_ALLOWED
                : EPHY_PERMISSION_DENIED;
 
+  location = ephy_web_view_get_location (view, TRUE);
+  g_return_if_fail (location != NULL);
+
   ephy_permission_manager_add_permission (manager, location,
                                           EPHY_PERMISSION_TYPE_POPUP,
                                           permission);



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