[tracker] miner-fs: Plug leak



commit f0fc3f844ba15fff789a3b4b9fa604a78626d8a8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 10 23:53:14 2014 +0100

    miner-fs: Plug leak
    
    The rdf types GStrv must be freed after usage.

 src/miners/fs/tracker-miner-files.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index dd14536..c0904cf 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -1984,15 +1984,19 @@ miner_files_add_rdf_types (TrackerSparqlBuilder *sparql,
 
        rdf_types = tracker_extract_module_manager_get_fallback_rdf_types (mime_type);
 
-       if (!rdf_types || !rdf_types[0])
+       if (!rdf_types)
                return;
 
-       tracker_sparql_builder_predicate (sparql, "a");
+       if (rdf_types[0]) {
+               tracker_sparql_builder_predicate (sparql, "a");
 
-       while (rdf_types[i]) {
-               tracker_sparql_builder_object (sparql, rdf_types[i]);
-               i++;
+               while (rdf_types[i]) {
+                       tracker_sparql_builder_object (sparql, rdf_types[i]);
+                       i++;
+               }
        }
+
+       g_strfreev (rdf_types);
 }
 
 static void


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