fix: Avoid wild pointers
author刘建强 <liujianqiang@uniontech.com>
Mon, 26 Jul 2021 01:36:26 +0000 (09:36 +0800)
committer刘建强 <liujianqiang@uniontech.com>
Wed, 28 Jul 2021 01:40:37 +0000 (09:40 +0800)
Pointer command is dangerous if there is no assignment.

Log: Avoid wild pointers

src/ostree/ot-main.c

index d153dcec5c8aa4cf8afdf2572147ebe3a011d3de..bbaba8b01df22a691f67808e9a9caf41ad8c2e68 100644 (file)
@@ -148,7 +148,6 @@ ostree_run (int    argc,
             OstreeCommand *commands,
             GError **res_error)
 {
-  OstreeCommand *command;
   GError *error = NULL;
   GCancellable *cancellable = NULL;
 #ifndef BUILDOPT_TSAN
@@ -187,7 +186,7 @@ ostree_run (int    argc,
 
   argc = out;
 
-  command = commands;
+  OstreeCommand *command = commands;
   while (command->name)
     {
       if (g_strcmp0 (command_name, command->name) == 0)