Verify memory allocations were successful.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10909 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2010-10-04 16:30:40 +00:00
parent d38a107995
commit 9ea69f8a05
7 changed files with 165 additions and 111 deletions

View File

@ -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);
}
/**