summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-07-14 13:15:34 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-07-18 11:04:16 +0800
commiteeb9744e5659d6ea035b9ba66b72c5c5b0a2c32e (patch)
treef0979aa210ea60950db2a73115bb47510c37b8c7 /ShellPkg
parent18bff310aae5d26d440e03742a208d7ecfa72387 (diff)
downloadedk2-platforms-eeb9744e5659d6ea035b9ba66b72c5c5b0a2c32e.tar.xz
ShellPkg/UefiShellLib.c: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index e4e7e3d829..3dcdba6ba0 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -2976,13 +2976,14 @@ ShellPrintHiiEx(
CHAR16 *HiiFormatString;
EFI_STATUS RetVal;
+ RetVal = EFI_DEVICE_ERROR;
+
VA_START (Marker, HiiFormatHandle);
HiiFormatString = HiiGetString(HiiFormatHandle, HiiFormatStringId, Language);
- ASSERT(HiiFormatString != NULL);
-
- RetVal = InternalShellPrintWorker(Col, Row, HiiFormatString, Marker);
-
- SHELL_FREE_NON_NULL(HiiFormatString);
+ if (HiiFormatString != NULL) {
+ RetVal = InternalShellPrintWorker (Col, Row, HiiFormatString, Marker);
+ SHELL_FREE_NON_NULL (HiiFormatString);
+ }
VA_END(Marker);
return (RetVal);