From 08aa37e0157271b87e917c598260644920c4ed57 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 14 Mar 2007 07:42:20 +0000 Subject: [PATCH] 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 --- .../Console/ConSplitter/Dxe/ConSplitterGraphics.c | 10 +++++++--- .../Universal/Console/Terminal/Dxe/Terminal.msa | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c index 9faeb56d12..2f60e11c40 100644 --- a/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c +++ b/EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c @@ -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); diff --git a/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.msa b/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.msa index 3403b35b75..8a281d763e 100644 --- a/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.msa +++ b/EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.msa @@ -6,7 +6,7 @@ 9E863906-A40F-4875-977F-5B93FF237FC6 1.0 Component description file for Terminal module. - This driver installs Simple Text In/Out protocol for terminal devices. + This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices). Copyright (c) 2006 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License