summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel1CommandsLib/For.c')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/For.c9
1 files changed, 8 insertions, 1 deletions
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);
}
/**