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




commit 4407ec31ffa350088bd2dd6a2802cace62fe94f7
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]