Plug leak of icon path when loading icons

This commit is contained in:
Christian Dywan 2010-10-14 21:06:45 +02:00
parent 18946b10b2
commit 5d7bbe6eb1

View 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);