[tracker] Plug some leaks in libtracker-miner.



commit 7c78f92b5186eda05184e3e6dcabd3fe5c8ee65c
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Mar 3 16:09:13 2010 +0100

    Plug some leaks in libtracker-miner.

 src/libtracker-miner/tracker-crawler.c  |    5 +++++
 src/libtracker-miner/tracker-dbus.c     |    2 ++
 src/libtracker-miner/tracker-miner-fs.c |    4 ++++
 src/libtracker-miner/tracker-storage.c  |    5 ++++-
 4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c
index 4d3bbf7..339d7fb 100644
--- a/src/libtracker-miner/tracker-crawler.c
+++ b/src/libtracker-miner/tracker-crawler.c
@@ -387,6 +387,11 @@ directory_root_info_free (DirectoryRootInfo *info)
 			 NULL);
 	g_node_destroy (info->tree);
 
+	g_queue_foreach (info->directory_processing_queue,
+			 (GFunc) directory_processing_data_free,
+			 NULL);
+	g_queue_free (info->directory_processing_queue);
+
 	g_slice_free (DirectoryRootInfo, info);
 }
 
diff --git a/src/libtracker-miner/tracker-dbus.c b/src/libtracker-miner/tracker-dbus.c
index ffbc3b4..c8affc6 100644
--- a/src/libtracker-miner/tracker-dbus.c
+++ b/src/libtracker-miner/tracker-dbus.c
@@ -251,6 +251,8 @@ tracker_miner_dbus_init (TrackerMiner          *miner,
 				 dbus_data,
 				 data,
 				 dbus_data_destroy);
+
+	g_free (name);
 }
 
 void
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index c0a6515..b36ba62 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1208,6 +1208,7 @@ item_add_or_update (TrackerMinerFS *fs,
 	g_object_unref (file);
 	g_object_unref (cancellable);
 	g_object_unref (sparql);
+	g_free (urn);
 
 	return retval;
 }
@@ -1497,6 +1498,7 @@ item_move (TrackerMinerFS *fs,
 		/* Destination file has gone away, ignore dest file and remove source if any */
 		retval = item_remove (fs, source_file);
 
+		g_free (source_iri);
 		g_free (source_uri);
 		g_free (uri);
 
@@ -2414,6 +2416,8 @@ crawled_directory_data_free (CrawledDirectoryData *data)
 			 NULL);
 	g_node_destroy (data->tree);
 
+	g_queue_free (data->nodes);
+
 	g_slice_free (CrawledDirectoryData, data);
 }
 
diff --git a/src/libtracker-miner/tracker-storage.c b/src/libtracker-miner/tracker-storage.c
index 6b587a6..31ee229 100644
--- a/src/libtracker-miner/tracker-storage.c
+++ b/src/libtracker-miner/tracker-storage.c
@@ -406,6 +406,7 @@ drives_setup (TrackerStorage *storage)
 	for (ld = drives; ld; ld = ld->next) {
 		GDrive *drive;
 		GList *volumes, *lv;
+		gchar *name;
 
 		drive = ld->data;
 
@@ -414,9 +415,10 @@ drives_setup (TrackerStorage *storage)
 		}
 		
 		volumes = g_drive_get_volumes (drive);
+		name = g_drive_get_name (drive);
 
 		g_debug ("Drive:'%s' found with %d %s:",
-		         g_drive_get_name (drive),
+		         name,
 		         g_list_length (volumes),
 		         (volumes && !volumes->next) ? "volume" : "volumes");
 
@@ -427,6 +429,7 @@ drives_setup (TrackerStorage *storage)
 
 		g_list_free (volumes);
 		g_object_unref (ld->data);
+		g_free (name);
 	}
 
 	g_list_free (drives);



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