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>
This commit is contained in:
Ruiyu Ni 2016-07-14 13:15:34 +08:00
parent 18bff310aa
commit eeb9744e56
1 changed files with 6 additions and 5 deletions

View File

@ -2976,13 +2976,14 @@ ShellPrintHiiEx(
CHAR16 *HiiFormatString; CHAR16 *HiiFormatString;
EFI_STATUS RetVal; EFI_STATUS RetVal;
RetVal = EFI_DEVICE_ERROR;
VA_START (Marker, HiiFormatHandle); VA_START (Marker, HiiFormatHandle);
HiiFormatString = HiiGetString(HiiFormatHandle, HiiFormatStringId, Language); HiiFormatString = HiiGetString(HiiFormatHandle, HiiFormatStringId, Language);
ASSERT(HiiFormatString != NULL); if (HiiFormatString != NULL) {
RetVal = InternalShellPrintWorker (Col, Row, HiiFormatString, Marker); RetVal = InternalShellPrintWorker (Col, Row, HiiFormatString, Marker);
SHELL_FREE_NON_NULL (HiiFormatString); SHELL_FREE_NON_NULL (HiiFormatString);
}
VA_END(Marker); VA_END(Marker);
return (RetVal); return (RetVal);