From c26d3095055aca93844d20a22c222f9f2ad8ba36 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Tue, 18 May 2021 09:07:52 -0400 Subject: [PATCH] nemo-location-entry.c: Don't modify a string we don't own. g_strstrip modifies in place, but we should avoid modifying the entry's internal string for propriety (and to silence a compiler warning). --- src/nemo-location-entry.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nemo-location-entry.c b/src/nemo-location-entry.c index 83def767f..23b35cb48 100644 --- a/src/nemo-location-entry.c +++ b/src/nemo-location-entry.c @@ -321,11 +321,11 @@ static void nemo_location_entry_activate (GtkEntry *entry) { NemoLocationEntry *loc_entry; - const gchar *entry_text; + gchar *entry_text; gchar *full_path, *uri_scheme = NULL; loc_entry = NEMO_LOCATION_ENTRY (entry); - entry_text = gtk_entry_get_text (entry); + entry_text = g_strdup (gtk_entry_get_text (entry)); if (entry_text != NULL && *entry_text != '\0') { uri_scheme = g_uri_parse_scheme (entry_text); @@ -342,6 +342,7 @@ nemo_location_entry_activate (GtkEntry *entry) } } + g_free (entry_text); g_free (uri_scheme); }