mirror of https://github.com/acidanthera/audk.git
ShellPkg/Ping6: 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:
parent
a915fea68e
commit
e7a5a238c3
ShellPkg/Library/UefiShellNetwork2CommandsLib
|
@ -961,7 +961,11 @@ ShellPing6 (
|
|||
ShellStatus = SHELL_SUCCESS;
|
||||
Private = AllocateZeroPool (sizeof (PING6_PRIVATE_DATA));
|
||||
|
||||
ASSERT (Private != NULL);
|
||||
if (Private == NULL) {
|
||||
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellNetwork2HiiHandle, L"Ping6");
|
||||
ShellStatus = SHELL_OUT_OF_RESOURCES;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
Private->ImageHandle = ImageHandle;
|
||||
Private->SendNum = SendNumber;
|
||||
|
|
Loading…
Reference in New Issue