tracker r3142 - in trunk: . src/libtracker-data



Author: carlosg
Date: Fri Mar 27 14:08:12 2009
New Revision: 3142
URL: http://svn.gnome.org/viewvc/tracker?rev=3142&view=rev

Log:
2009-03-27  Carlos Garnacho  <carlos imendio com>

        * src/libtracker-data/tracker-data-metadata.c
        (tracker_data_metadata_insert_values): Create a copy of the list
        before freeing the old values, since the new list could be constructed
        from these old values. Fixes NB#100642.

Modified:
   trunk/ChangeLog
   trunk/src/libtracker-data/tracker-data-metadata.c

Modified: trunk/src/libtracker-data/tracker-data-metadata.c
==============================================================================
--- trunk/src/libtracker-data/tracker-data-metadata.c	(original)
+++ trunk/src/libtracker-data/tracker-data-metadata.c	Fri Mar 27 14:08:12 2009
@@ -145,7 +145,7 @@
 				     const GList	 *list)
 {
 	TrackerField *field;
-	GList        *old_values;
+	GList        *old_values, *copy;
 
 	g_return_if_fail (metadata != NULL);
 	g_return_if_fail (field_name != NULL);
@@ -164,6 +164,8 @@
 	g_return_if_fail (TRACKER_IS_FIELD (field));
 	g_return_if_fail (tracker_field_get_multiple_values (field) == TRUE);
 
+	copy = tracker_glist_copy_with_string_data ((GList *)list);
+
 	old_values = g_hash_table_lookup (metadata->table, field);
 
 	if (old_values) {
@@ -173,7 +175,7 @@
 
 	g_hash_table_replace (metadata->table,
 			      g_object_ref (field),
-			      tracker_glist_copy_with_string_data ((GList *)list));
+			      copy);
 }
 
 /**



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