From 9cc3e63045af9ea2909272d3947304863b6088de Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Wed, 14 Oct 2015 22:04:35 +0200 Subject: [PATCH] gtkplacesview: plug leak https://bugzilla.gnome.org/show_bug.cgi?id=756568 --- gtk/gtkplacesview.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 2796c7a61b..7f5f8a129a 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -1829,6 +1829,8 @@ on_address_entry_text_changed (GtkPlacesView *view) supported = FALSE; supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ()); address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry))); + scheme = g_uri_parse_scheme (address); + if (strlen (address) > 0) gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->address_entry), GTK_ENTRY_ICON_SECONDARY, @@ -1841,8 +1843,6 @@ on_address_entry_text_changed (GtkPlacesView *view) if (!supported_protocols) goto out; - scheme = g_uri_parse_scheme (address); - if (!scheme) goto out; @@ -1852,6 +1852,7 @@ on_address_entry_text_changed (GtkPlacesView *view) out: gtk_widget_set_sensitive (priv->connect_button, supported); g_free (address); + g_free (scheme); } static void