diff options
-rw-r--r-- | ShellPkg/Application/Shell/ShellProtocol.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index c3331def82..55a1e43f06 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -3699,8 +3699,10 @@ CreatePopulateInstallShellProtocol ( );
if (!EFI_ERROR(Status)) {
OldProtocolNode = AllocateZeroPool(sizeof(SHELL_PROTOCOL_HANDLE_LIST));
- if (OldProtocolNode == NULL && !IsListEmpty (&ShellInfoObject.OldShellList.Link)) {
- CleanUpShellProtocol (&mShellProtocol);
+ if (OldProtocolNode == NULL) {
+ if (!IsListEmpty (&ShellInfoObject.OldShellList.Link)) {
+ CleanUpShellProtocol (&mShellProtocol);
+ }
Status = EFI_OUT_OF_RESOURCES;
break;
}
|