From 5d7bbe6eb16835a04e4bffb60f40cee8b7427f08 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 14 Oct 2010 21:06:45 +0200 Subject: [PATCH] Plug leak of icon path when loading icons --- midori/midori-view.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 40ff24d3..a72e57b8 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -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);