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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sergei Dmitrouk <sergei@posteo.net>
Message-Id: <20210511225616.5942-2-sergei@posteo.net>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Sergei Dmitrouk 2021-05-11 22:56:15 +00:00 committed by mergify[bot]
parent 22ac5cc9d9
commit eec44cdd00
1 changed files with 5 additions and 0 deletions

View File

@ -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.