diff --git a/browser/ui/file_dialog_gtk.cc b/browser/ui/file_dialog_gtk.cc index 581ab692229..8effcfa3aea 100644 --- a/browser/ui/file_dialog_gtk.cc +++ b/browser/ui/file_dialog_gtk.cc @@ -64,7 +64,9 @@ class FileChooserDialog { base::FilePath GetFileName() const { gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog_)); - return base::FilePath(filename); + base::FilePath path(filename); + g_free(filename); + return path; } CHROMEGTK_CALLBACK_1(FileChooserDialog, void,