[gnome-panel] run-dialog: do null check before using tokens



commit 52aa942871ba24e8f0363fd35665c683eee72146
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Mar 7 21:20:35 2020 +0200

    run-dialog: do null check before using tokens
    
    CID 1445702.

 gnome-panel/panel-run-dialog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 69ef55df1..d645d1f17 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -684,13 +684,13 @@ fuzzy_command_match (const char *cmd1,
 
        /* same for the user command */
        tokens = g_strsplit (cmd2, " ", -1);
-       word2 = g_path_get_basename (tokens [0]);
        if (!tokens || !tokens [0]) {
                g_free (word1);
                g_strfreev (tokens);
                return FALSE;
        }
 
+       word2 = g_path_get_basename (tokens [0]);
        g_strfreev (tokens);
 
        if (!strcmp (word1, word2)) {


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