From eec44cdd0058ad208fa730796a306eae9138db58 Mon Sep 17 00:00:00 2001 From: Sergei Dmitrouk Date: Tue, 11 May 2021 22:56:15 +0000 Subject: [PATCH] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning `Dupes` is used only if `Duplicates != NULL` and function is left if allocation of memory for `Dupes` fails, so it can't be used uninitialized. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3228 Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sergei Dmitrouk Message-Id: <20210511225616.5942-2-sergei@posteo.net> Reviewed-by: Laszlo Ersek --- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index b06d22592d..81923c8ae7 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -2128,6 +2128,11 @@ ShellSortFileList ( } } + // + // Set Dupes to suppress incorrect compiler/analyzer warnings. + // + Dupes = NULL; + // // If separation of duplicates has been requested, allocate the list for // them.