[tracker/wip/carlosg/service-fixes: 3/8] libtracker-data: Fix possible critical in error paths



commit 20abf9bf51a47e3e71e177ee6c57ff27e384d5da
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jun 8 16:29:12 2020 +0200

    libtracker-data: Fix possible critical in error paths
    
    If the file is NULL, we'd trigger a warning here.

 src/libtracker-data/tracker-db-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 0b22527ed..f2b8a247c 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -1110,7 +1110,7 @@ tracker_db_manager_attach_database (TrackerDBManager    *db_manager,
        }
 
        if (!tracker_db_interface_attach_database (iface, file, name, error)) {
-               g_object_unref (file);
+               g_clear_object (&file);
                return FALSE;
        }
 


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