[tracker-miners/wip/carlosg/coverity-fixes: 11/11] libtracker-miners-common: Check g_remove() return value




commit b3e3af39b2172e4e72546b046612c5f3ac210027
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 7 19:06:30 2020 +0200

    libtracker-miners-common: Check g_remove() return value
    
    Spotted by Coverity
    
    CID: #361432

 src/libtracker-miners-common/tracker-error-report.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miners-common/tracker-error-report.c 
b/src/libtracker-miners-common/tracker-error-report.c
index e9567ee50..33688844a 100644
--- a/src/libtracker-miners-common/tracker-error-report.c
+++ b/src/libtracker-miners-common/tracker-error-report.c
@@ -96,7 +96,10 @@ tracker_error_report_delete (GFile *file)
 
        uri = g_file_get_uri (file);
        report_path = get_report_file (uri);
-       g_remove (report_path);
+       if (g_remove (report_path) < 0) {
+               g_warning ("Error removing path '%s': %m",
+                          report_path);
+       }
 
        g_free (report_path);
        g_free (uri);


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