[tracker/unsupported-ontology-change] libtracker-data: Fix memory leak, to_remove was NULL at the end



commit 5398a7bca1c85248452a2dce2b33aa6c6bde350a
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Sep 13 14:21:06 2011 +0200

    libtracker-data: Fix memory leak, to_remove was NULL at the end

 src/libtracker-data/tracker-data-manager.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 13ce215..487a6ad 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1426,9 +1426,11 @@ check_for_deleted_super_properties (TrackerProperty  *property,
 	}
 
 	if (to_remove) {
-		while (to_remove) {
+		GList *copy = to_remove;
+
+		while (copy) {
 			GError *n_error = NULL;
-			TrackerProperty *prop_to_remove = to_remove->data;
+			TrackerProperty *prop_to_remove = copy->data;
 			const gchar *object = tracker_property_get_uri (prop_to_remove);
 			const gchar *subject = tracker_property_get_uri (property);
 
@@ -1447,7 +1449,7 @@ check_for_deleted_super_properties (TrackerProperty  *property,
 				return;
 			}
 
-			to_remove = to_remove->next;
+			copy = copy->next;
 		}
 		g_list_free (to_remove);
 	}



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