Add check whether input parameter is NULL before call freepool API defined in MDE.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2461 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2007-03-14 07:42:20 +00:00
parent 5db2b1e12d
commit 08aa37e015
2 changed files with 8 additions and 4 deletions

View File

@ -1314,8 +1314,10 @@ DevNullTextOutSetMode (
Private->TextOutMode.Mode = (INT32) ModeNumber;
Private->DevNullColumns = Column;
Private->DevNullRows = Row;
FreePool (Private->DevNullScreen);
if (Private->DevNullScreen != NULL) {
FreePool (Private->DevNullScreen);
}
Size = (Row * (Column + 1)) * sizeof (CHAR16);
Private->DevNullScreen = AllocateZeroPool (Size);
@ -1323,7 +1325,9 @@ DevNullTextOutSetMode (
return EFI_OUT_OF_RESOURCES;
}
FreePool (Private->DevNullAttributes);
if (Private->DevNullAttributes != NULL) {
FreePool (Private->DevNullAttributes);
}
Size = Row * Column * sizeof (INT32);
Private->DevNullAttributes = AllocateZeroPool (Size);