X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel1CommandsLib%2FFor.c;h=297a137664616c546fe89e509f6b04ad7d22b1c8;hp=0e68119b8dd87451284debcc607fcb221ac38cd1;hb=9ea69f8a05b808b4bab81b608436a02e2f2fba09;hpb=d38a107995ef90254713dcebf8f6bddb70183a1e diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c index 0e68119b8d..297a137664 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c @@ -103,8 +103,11 @@ typedef struct { @param[in] Alias The alias to test for. @param[in] CommandString The updated command string. @param[in,out] List The list to search. + + @retval EFI_SUCCESS The operation was completed successfully. + @retval EFI_OUT_OF_RESOURCES There was not enough free memory. **/ -VOID +EFI_STATUS EFIAPI InternalUpdateAliasOnList( IN CONST CHAR16 *Alias, @@ -139,12 +142,16 @@ InternalUpdateAliasOnList( } if (!Found) { Node = AllocateZeroPool(sizeof(ALIAS_LIST)); + if (Node == NULL) { + return (EFI_OUT_OF_RESOURCES); + } ASSERT(Node->Alias == NULL); Node->Alias = StrnCatGrow(&Node->Alias, NULL, Alias, 0); ASSERT(Node->CommandString == NULL); Node->CommandString = StrnCatGrow(&Node->CommandString, NULL, CommandString, 0); InsertTailList(List, &Node->Link); } + return (EFI_SUCCESS); } /**