[tracker] libtracker-data: Fix double free in ontology cache code



commit 84325f849d16714a5efc7a9e7fd71d63f26106e7
Author: Jürg Billeter <j bitron ch>
Date:   Mon Jan 10 11:02:48 2011 +0100

    libtracker-data: Fix double free in ontology cache code
    
    Fixes NB#216350.

 src/libtracker-data/tracker-class.c    |    5 ++---
 src/libtracker-data/tracker-property.c |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-data/tracker-class.c b/src/libtracker-data/tracker-class.c
index 856f64c..6f419cd 100644
--- a/src/libtracker-data/tracker-class.c
+++ b/src/libtracker-data/tracker-class.c
@@ -232,12 +232,11 @@ tracker_class_get_super_classes (TrackerClass *service)
 			g_variant_iter_init (&iter, variant);
 			while (g_variant_iter_loop (&iter, "s", &uri)) {
 				super_class = tracker_ontologies_get_class_by_uri (uri);
-				g_free (uri);
 
 				tracker_class_add_super_class (service, super_class);
-
-				g_object_unref (super_class);
 			}
+
+			g_variant_unref (variant);
 		}
 	}
 
diff --git a/src/libtracker-data/tracker-property.c b/src/libtracker-data/tracker-property.c
index 27afff7..810ec6d 100644
--- a/src/libtracker-data/tracker-property.c
+++ b/src/libtracker-data/tracker-property.c
@@ -338,12 +338,11 @@ tracker_property_get_domain_indexes (TrackerProperty *property)
 			g_variant_iter_init (&iter, variant);
 			while (g_variant_iter_loop (&iter, "s", &uri)) {
 				domain_index = tracker_ontologies_get_class_by_uri (uri);
-				g_free (uri);
 
 				tracker_property_add_domain_index (property, domain_index);
-
-				g_object_unref (domain_index);
 			}
+
+			g_variant_unref (variant);
 		}
 	}
 



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