Add pointer check for NULL before dereference it.

Signed-off-by: sfu5
Reviewed-by: xdu2
Reviewed-by: ydong10


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12514 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
sfu5
2011-10-08 02:55:30 +00:00
parent 4bc6ad3935
commit 02a758cb0b
9 changed files with 211 additions and 37 deletions

View File

@@ -2446,9 +2446,7 @@ InternalHiiGrowOpCodeHandle (
OpCodeBuffer->BufferSize + (Size + HII_LIB_OPCODE_ALLOCATION_SIZE),
OpCodeBuffer->Buffer
);
if (Buffer == NULL) {
return NULL;
}
ASSERT (Buffer != NULL);
OpCodeBuffer->Buffer = Buffer;
OpCodeBuffer->BufferSize += (Size + HII_LIB_OPCODE_ALLOCATION_SIZE);
}