[tracker] libtracker-fts: Free the list



commit 457387061b5d0bdf6e129b93216df37bffb4d6a5
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 7 13:39:18 2014 +0100

    libtracker-fts: Free the list
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725890

 src/libtracker-fts/tracker-fts.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index c4fcedb..b39c67e 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -205,6 +205,7 @@ static void
 tracker_fts_init_property_names (GHashTable *tables)
 {
        GHashTableIter iter;
+       GList *c;
        GList *columns;
        GList *table_columns;
        gchar **ptr;
@@ -216,11 +217,12 @@ tracker_fts_init_property_names (GHashTable *tables)
        }
 
        ptr = property_names = g_new0 (gchar *, g_list_length (columns));
-       while (columns) {
-               *ptr = g_strdup (columns->data);
+       for (c = columns; c!= NULL ; c = c->next) {
+               *ptr = g_strdup (c->data);
                ptr ++;
-               columns = columns->next;
        }
+
+       g_list_free (columns);
 }
 
 gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]