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
This commit is contained in:
Andreas Köhler 2009-02-14 19:05:29 +00:00
parent 1449197182
commit 3b8fc6c0a6

View File

@ -253,7 +253,6 @@ static void ok_button_clicked(GtkWidget* widget, GncCsvPreview* preview)
for(i = 0; i < ncols; i++) for(i = 0; i < ncols; i++)
{ {
int type; /* The column type contained in this column. */ int type; /* The column type contained in this column. */
gboolean found;
gchar* contents; /* The column type string in this column. */ gchar* contents; /* The column type string in this column. */
/* Get the type string first. (store is arranged so that every two /* 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 * 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++) for(type = 0; type < GNC_CSV_NUM_COL_TYPES; type++)
{ {
/* ... we find one that matches with what's in the column. */ /* ... we find one that matches with what's in the column. */
found = !strcmp(contents, _(gnc_csv_column_type_strs[type])); if(!strcmp(contents, _(gnc_csv_column_type_strs[type])))
g_free(contents);
if(found)
{ {
/* Set the column_types array appropriately and quit. */ /* Set the column_types array appropriately and quit. */
column_types->data[i] = type; column_types->data[i] = type;
break; break;
} }
} }
/* Free the type string created by gtk_tree_model_get() */
g_free(contents);
} }
/* Close the dialog. */ /* Close the dialog. */