// Build mailbox in HOB and setup Mailbox Set In Pei flag\r
//\r
Mailbox = AllocateZeroPool (sizeof (DEBUG_AGENT_MAILBOX));\r
+ if (Mailbox == NULL) {\r
+ DEBUG ((EFI_D_ERROR, "DebugAgent: Failed to allocate memory!\n"));\r
+ CpuDeadLoop ();\r
+ }\r
MailboxLocation = (UINT64)(UINTN)Mailbox;\r
MailboxLocationPointer = BuildGuidDataHob (\r
&gEfiDebugAgentGuid,\r