Skip to content

Commit

Permalink
nemo-location-entry.c: Don't modify a string we don't own.
Browse files Browse the repository at this point in the history
g_strstrip modifies in place, but we should avoid modifying the
entry's internal string for propriety (and to silence a compiler
warning).
  • Loading branch information
mtwebster committed May 18, 2021
1 parent 92126a8 commit c26d309
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nemo-location-entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -342,6 +342,7 @@ nemo_location_entry_activate (GtkEntry *entry)
}
}

g_free (entry_text);
g_free (uri_scheme);
}

Expand Down

0 comments on commit c26d309

Please sign in to comment.