diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c index c4f081826c..af41f06841 100644 --- a/gnucash/gnome-utils/dialog-options.c +++ b/gnucash/gnome-utils/dialog-options.c @@ -3478,6 +3478,7 @@ gnc_option_set_ui_value_pixmap (GNCOption *option, gboolean use_default, g_strdup (string), g_free); DEBUG("Set %s, retrieved %s", string, test ? test : "(null)"); gnc_image_option_update_preview_cb (GTK_FILE_CHOOSER(widget), option); + g_free (test); } LEAVE("FALSE"); g_free ((gpointer *) string); diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c index 677125c1e9..8d0d9af55c 100644 --- a/gnucash/gnome-utils/gnc-file.c +++ b/gnucash/gnome-utils/gnc-file.c @@ -71,7 +71,6 @@ gnc_file_dialog_int (GtkWindow *parent, ) { GtkWidget *file_box; - const char *internal_name; char *file_name = NULL; gchar * okbutton = NULL; const gchar *ok_icon = NULL; @@ -171,17 +170,17 @@ gnc_file_dialog_int (GtkWindow *parent, else { /* look for constructs like postgres://foo */ - internal_name = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER (file_box)); - if (internal_name != NULL) + file_name = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER (file_box)); + if (file_name != NULL) { - if (strstr (internal_name, "file://") == internal_name) + if (strstr (file_name, "file://") == file_name) { + g_free (file_name); /* nope, a local file name */ - internal_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (file_box)); + file_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (file_box)); } - file_name = g_strdup(internal_name); + file_name_list = g_slist_append (file_name_list, file_name); } - file_name_list = g_slist_append (file_name_list, file_name); } } gtk_widget_destroy(GTK_WIDGET(file_box)); diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c index 3e83a74210..3250e6c2f9 100644 --- a/gnucash/gnome/dialog-doclink.c +++ b/gnucash/gnome/dialog-doclink.c @@ -190,10 +190,10 @@ fcb_clicked_cb (GtkButton *button, GtkWidget *ok_button) DEBUG("Native file uri is '%s'", uri); g_object_set_data_full (G_OBJECT(button), "uri", g_strdup (uri), g_free); - g_free (uri); g_free (filename); g_free (unescape_filename); } + g_free (uri); file_ok_cb (button, ok_button); } g_object_unref (native); diff --git a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp index 15c24dd1cf..ea90fbd0f1 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp @@ -739,7 +739,10 @@ CsvImpPriceAssist::check_for_valid_filename () { auto file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(file_chooser)); if (!file_name || g_file_test (file_name, G_FILE_TEST_IS_DIR)) + { + g_free (file_name); return false; + } auto filepath = gnc_uri_get_path (file_name); auto starting_dir = g_path_get_dirname (filepath); diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp index 07d1cb1d0e..8c499d93a2 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp @@ -702,7 +702,10 @@ CsvImpTransAssist::check_for_valid_filename () { auto file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(file_chooser)); if (!file_name || g_file_test (file_name, G_FILE_TEST_IS_DIR)) + { + g_free (file_name); return false; + } auto filepath = gnc_uri_get_path (file_name); auto starting_dir = g_path_get_dirname (filepath);