[tracker-miners/wip/carlosg/coverity-fixes: 9/11] tracker: Check tracker_sparql_cursor_next() return value.




commit 347eae8cc4cac5228b1d9cfa3d99fcb9e3b8e18c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 7 19:02:28 2020 +0200

    tracker: Check tracker_sparql_cursor_next() return value.
    
    As done most usually. Spotted by Coverity.
    
    CID: #354741

 src/tracker/tracker-status.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/tracker/tracker-status.c b/src/tracker/tracker-status.c
index a432c616d..56dffe3eb 100644
--- a/src/tracker/tracker-status.c
+++ b/src/tracker/tracker-status.c
@@ -217,10 +217,7 @@ get_file_and_folder_count (int *files,
 
                cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
 
-               if (cursor)
-                       tracker_sparql_cursor_next (cursor, NULL, &error);
-
-               if (error) {
+               if (error || !tracker_sparql_cursor_next (cursor, NULL, &error)) {
                        g_printerr ("%s, %s\n",
                                    _("Could not get basic status for Tracker"),
                                    error->message);


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