[tracker-miners/wip/carlosg/coverity-fixes: 16/28] tracker-miner-fs: Plug leak




commit 988a94a5be9a9ea85f894c52390c23be5d657f25
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 01:05:24 2021 +0200

    tracker-miner-fs: Plug leak
    
    The domain_ontology variable is not being freed in some error
    paths.
    
    CID: #365673

 src/miners/fs/tracker-main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 7c67d8dce..52cb4ed7c 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -629,6 +629,8 @@ check_eligible (void)
 
        domain_ontology = tracker_domain_ontology_new (domain_ontology_name, NULL, &error);
        ontology = tracker_domain_ontology_get_ontology (domain_ontology);
+       tracker_domain_ontology_unref (domain_ontology);
+
        sparql_conn = tracker_sparql_connection_new (0,
                                                      NULL,
                                                      ontology,
@@ -739,7 +741,6 @@ check_eligible (void)
        g_object_unref (file);
        g_object_unref (miner_files);
        g_object_unref (info);
-       tracker_domain_ontology_unref (domain_ontology);
 
        return (indexable && parents_indexable) ? EXIT_SUCCESS : EXIT_FAILURE;
 }


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