verify that a memory allocation was successful.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10907 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2010-10-04 16:28:35 +00:00
parent 0ab85bef03
commit e53bf79de7
1 changed files with 3 additions and 0 deletions

View File

@ -1279,6 +1279,9 @@ ShellCommandConsistMappingGenMappingName (
NewSize = (Str.Len + 1) * sizeof (CHAR16);
Str.Str = ReallocatePool (Str.Len, NewSize, Str.Str);
if (Str.Str == NULL) {
return (NULL);
}
Str.Str[Str.Len] = CHAR_NULL;
return Str.Str;
}