diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2016-07-14 13:15:34 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-25 11:05:14 +0800 |
commit | 1faa7d0c4cac5675833829ee79db5b5a0b129bd4 (patch) | |
tree | 83f01c622bf77ea45c51f598f05edd030186fb2c /ShellPkg/Library/UefiShellLib | |
parent | 3c95e16eba49a11bf0ee92372ff2f8b70e1a3436 (diff) | |
download | edk2-platforms-1faa7d0c4cac5675833829ee79db5b5a0b129bd4.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>
(cherry picked from commit eeb9744e5659d6ea035b9ba66b72c5c5b0a2c32e)
Diffstat (limited to 'ShellPkg/Library/UefiShellLib')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 11 |
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);
|