AUDIT: r17900 - gnucash/trunk/src/import-export/csv - Bug #571161: Fix r17036 and free every column type only once.

Andreas Köhler andi5 at cvs.gnucash.org
Sat Feb 14 14:05:29 EST 2009


Author: andi5
Date: 2009-02-14 14:05:29 -0500 (Sat, 14 Feb 2009)
New Revision: 17900
Trac: http://svn.gnucash.org/trac/changeset/17900

Modified:
   gnucash/trunk/src/import-export/csv/gnc-csv-import.c
Log:
Bug #571161: Fix r17036 and free every column type only once.

BP

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-import.c	2009-02-14 19:05:17 UTC (rev 17899)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-import.c	2009-02-14 19:05:29 UTC (rev 17900)
@@ -253,7 +253,6 @@
   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 @@
     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. */



More information about the gnucash-changes mailing list