[tracker-miners/wip/hadess/fix-warnings: 2/2] cli: Fix uninitialised variable




commit 8ee5d1a835ad7333c8c5680e88d1ef87a348fcac
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 22 16:17:06 2021 +0100

    cli: Fix uninitialised variable
    
    ../src/tracker/tracker-info.c: In function ‘output_eligible_status_for_file.isra’:
    /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘tracker_miner_fs_path’ may be used 
uninitialized in this function [-Wmaybe-uninitialized]
       28 |   g_free (*pp);
          |   ^~~~~~~~~~~~
    ../src/tracker/tracker-info.c:366:19: note: ‘tracker_miner_fs_path’ was declared here
      366 |  g_autofree char *tracker_miner_fs_path;
          |                   ^~~~~~~~~~~~~~~~~~~~~

 src/tracker/tracker-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/tracker/tracker-info.c b/src/tracker/tracker-info.c
index 7ed395595..f01f5d3b8 100644
--- a/src/tracker/tracker-info.c
+++ b/src/tracker/tracker-info.c
@@ -363,7 +363,7 @@ static gboolean
 output_eligible_status_for_file (gchar   *path,
                                  GError **error)
 {
-       g_autofree char *tracker_miner_fs_path;
+       g_autofree char *tracker_miner_fs_path = NULL;
 
        tracker_miner_fs_path = g_build_filename (LIBEXECDIR, "tracker-miner-fs-3", NULL);
 


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