Commit 9d8fadee authored by Daniel Boles's avatar Daniel Boles

FileChooserWidget: Avoid crash freeing static str

Having a FileChooserDialog in location-entry mode then pressing
<primary>f to move to search mode would crash with an invalid free().

In that case, FileChooserWidget.get_subtitle() returned a static string
straight from gettext. This crashed when the GBinding from :subtitle to
FileChooserDialog’s HeaderBar:subtitle shortly tried to free the string.

Fix by duplicating the string before returning it, like all other paths.
parent 0e016686
......@@ -3271,7 +3271,7 @@ gtk_file_chooser_widget_get_subtitle (GtkFileChooserWidget *impl)
gchar *location;
subtitle = _("Searching");
subtitle = g_strdup (_("Searching"));
location = gtk_places_sidebar_get_location_title (GTK_PLACES_SIDEBAR (priv->places_sidebar));
if (location)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment