]> spindle.queued.net Git - midori/commitdiff
Plug leak of icon path when loading icons
authorChristian Dywan <christian@twotoasts.de>
Thu, 14 Oct 2010 19:06:45 +0000 (21:06 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 14 Oct 2010 19:07:55 +0000 (21:07 +0200)
midori/midori-view.c

index 40ff24d3dfb9348cb57f3e5cd447d2153752df0d..a72e57b8a7e663bc24ef10de2603bd8289badd41 100644 (file)
@@ -872,9 +872,9 @@ _midori_web_view_load_icon (MidoriView* view)
                 i++;
             if (view->uri[i] == '/')
             {
-                icon_uri = g_strdup (view->uri);
-                icon_uri[i] = '\0';
-                icon_uri = g_strdup_printf ("%s/favicon.ico", icon_uri);
+                gchar* path = g_strndup (view->uri, i);
+                icon_uri = g_strdup_printf ("%s/favicon.ico", path);
+                g_free (path);
             }
             else
                 icon_uri = g_strdup_printf ("%s/favicon.ico", view->uri);