[tracker/wip/carlosg/coverity-fixes: 3/16] tracker: Check return value of g_setenv




commit 4c855370dcbc07b9dbd582e9cb7a7b5a63425932
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 23 00:17:32 2021 +0200

    tracker: Check return value of g_setenv
    
    This function might fail (says Coverity), so check the error
    value.
    
    CID: #1501106

 src/tracker/tracker-help.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/tracker/tracker-help.c b/src/tracker/tracker-help.c
index 072d4f5a0..0f74fb8ce 100644
--- a/src/tracker/tracker-help.c
+++ b/src/tracker/tracker-help.c
@@ -43,7 +43,8 @@ setup_man_path (void)
                g_string_append (new_path, old_path); 
        }
 
-       g_setenv ("MANPATH", new_path->str, TRUE);
+       if (!g_setenv ("MANPATH", new_path->str, TRUE))
+               g_warning ("Could not set MANPATH");
 
        g_string_free (new_path, TRUE);
 }


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