check that memory allocation was successful.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11568 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-04-19 17:54:42 +00:00
parent f20076daaf
commit f8d3e6898a
1 changed files with 6 additions and 0 deletions

View File

@ -2606,6 +2606,12 @@ InternalShellPrintWorker(
mPostReplaceFormat = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize)); mPostReplaceFormat = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
mPostReplaceFormat2 = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize)); mPostReplaceFormat2 = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
if (mPostReplaceFormat == NULL || mPostReplaceFormat2 == NULL) {
SHELL_FREE_NON_NULL(mPostReplaceFormat);
SHELL_FREE_NON_NULL(mPostReplaceFormat2);
return (EFI_OUT_OF_RESOURCES);
}
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
OriginalAttribute = gST->ConOut->Mode->Attribute; OriginalAttribute = gST->ConOut->Mode->Attribute;