From 3b8fc6c0a69febde673edceffddb8f22785161d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Sat, 14 Feb 2009 19:05:29 +0000 Subject: [PATCH] Bug #571161: Fix r17036 and free every column type only once. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17900 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/import-export/csv/gnc-csv-import.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/import-export/csv/gnc-csv-import.c b/src/import-export/csv/gnc-csv-import.c index 68eec7bc37..fa2c3e2398 100644 --- a/src/import-export/csv/gnc-csv-import.c +++ b/src/import-export/csv/gnc-csv-import.c @@ -253,7 +253,6 @@ static void ok_button_clicked(GtkWidget* widget, GncCsvPreview* preview) for(i = 0; i < ncols; i++) { int type; /* The column type contained in this column. */ - gboolean found; gchar* contents; /* The column type string in this column. */ /* Get the type string first. (store is arranged so that every two * columns is a pair of the model used for the combobox and the @@ -265,15 +264,15 @@ static void ok_button_clicked(GtkWidget* widget, GncCsvPreview* preview) for(type = 0; type < GNC_CSV_NUM_COL_TYPES; type++) { /* ... we find one that matches with what's in the column. */ - found = !strcmp(contents, _(gnc_csv_column_type_strs[type])); - g_free(contents); - if(found) + if(!strcmp(contents, _(gnc_csv_column_type_strs[type]))) { /* Set the column_types array appropriately and quit. */ column_types->data[i] = type; break; } } + /* Free the type string created by gtk_tree_model_get() */ + g_free(contents); } /* Close the dialog. */