From 28174970c74903a856a87542a54c0bef1dacbc86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BB=BA=E5=BC=BA?= Date: Mon, 26 Jul 2021 09:36:26 +0800 Subject: [PATCH] fix: Avoid wild pointers Pointer command is dangerous if there is no assignment. Log: Avoid wild pointers --- src/ostree/ot-main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c index d153dcec..bbaba8b0 100644 --- a/src/ostree/ot-main.c +++ b/src/ostree/ot-main.c @@ -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)