[epiphany/gnome-3-28] uri-tester: Fix urlcache memory leak



commit facfa80c2b36ca7479de4323b77019965363dc6e
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Jun 13 11:10:23 2018 -0500

    uri-tester: Fix urlcache memory leak
    
    Something went wrong with the git history related to e17dc362, and we
    wound up allocating a string here that will never be freed. Whoops.
    
    Then we pass it through GPOINTER_TO_INT() even though it is really a
    random pointer and not going to be a meaningful integer value, and
    return it as a gboolean. So we have a gboolean that is neither TRUE nor
    FALSE, which is bad. But fortunately, it looks like it's never
    explicitly compared to TRUE, so there should have been no behavioral
    issue besides the leak.
    
    This is related to #37.

 embed/web-extension/ephy-uri-tester.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/embed/web-extension/ephy-uri-tester.c b/embed/web-extension/ephy-uri-tester.c
index 70f7cfd77..a871f6624 100644
--- a/embed/web-extension/ephy-uri-tester.c
+++ b/embed/web-extension/ephy-uri-tester.c
@@ -189,7 +189,7 @@ ephy_uri_tester_is_matched (EphyUriTester *tester,
 
   /* Look for a match either by key or by pattern. */
   if (ephy_uri_tester_is_matched_by_key (tester, opts, req_uri, page_uri, whitelist)) {
-    g_hash_table_insert (urlcache, g_strdup (req_uri), g_strdup ("1"));
+    g_hash_table_insert (urlcache, g_strdup (req_uri), GINT_TO_POINTER (TRUE));
     return TRUE;
   }
 


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