Commit 1e505c42 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

Create a copy of the list before freeing the old values, since the new

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.

svn path=/trunk/; revision=3142
parent e6053729
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.
2009-03-26 Mikael Ottela <mikael.ottela@ixonos.com>
* src/libtracker-data/tracker-data-search.c: Added the missing
......
......@@ -145,7 +145,7 @@ tracker_data_metadata_insert_values (TrackerDataMetadata *metadata,
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 @@ tracker_data_metadata_insert_values (TrackerDataMetadata *metadata,
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 @@ tracker_data_metadata_insert_values (TrackerDataMetadata *metadata,
g_hash_table_replace (metadata->table,
g_object_ref (field),
tracker_glist_copy_with_string_data ((GList *)list));
copy);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment