summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2024-10-03 10:31:31 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-29 02:09:18 +0000
commit334f5748869996eee994f9dee41f3e6a3d9bd087 (patch)
treedc0956044dac9de2d2d6443f3c01cc922b75ec4e /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parentc80c222198a88847f3e1ce3e482af8e4c0bd36fa (diff)
downloadedk2-334f5748869996eee994f9dee41f3e6a3d9bd087.tar.gz
ShellPkg: CodeQL Fixes
Includes changes across the module for the following CodeQL rules: - cpp/comparison-with-wider-type - cpp/overflow-buffer - cpp/redundant-null-check-param - cpp/uselesstest Co-authored-by: Taylor Beebe <taylor.d.beebe@gmail.com> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 93e36197b2..f023505300 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -3820,7 +3820,10 @@ ShellPromptForResponseHii (
Prompt = HiiGetString (HiiFormatHandle, HiiFormatStringId, NULL);
Status = ShellPromptForResponse (Type, Prompt, Response);
- FreePool (Prompt);
+ if (Prompt != NULL) {
+ FreePool (Prompt);
+ }
+
return (Status);
}