summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-31 06:35:23 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-31 06:35:23 +0000
commitc473cc175602bb2c9aa02636c6a8b560d935130f (patch)
tree9e8e1ca30ad39525b27f3f161633a853313b1998 /MdeModulePkg/Library
parentf7763aa493ec73f2f1352b4123da55d333b296dd (diff)
downloadedk2-c473cc175602bb2c9aa02636c6a8b560d935130f.zip
edk2-c473cc175602bb2c9aa02636c6a8b560d935130f.tar.gz
edk2-c473cc175602bb2c9aa02636c6a8b560d935130f.tar.bz2
Fix a bug introduced when removing the SafeFreePool. Pointer should be checked before FreePool.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6349 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/GenericBdsLib/BdsMisc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
index 994f90e..3136341 100644
--- a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -305,7 +305,9 @@ BdsLibRegisterNewOption (
// Got the option, so just return
//
FreePool (OptionPtr);
- FreePool (TempOptionPtr);
+ if (TempOptionPtr != NULL) {
+ FreePool (TempOptionPtr);
+ }
return EFI_SUCCESS;
} else {
//
@@ -364,7 +366,9 @@ BdsLibRegisterNewOption (
//
if (EFI_ERROR (Status) || UpdateDescription) {
FreePool (OptionPtr);
- FreePool (TempOptionPtr);
+ if (TempOptionPtr != NULL) {
+ FreePool (TempOptionPtr);
+ }
return Status;
}
@@ -386,7 +390,9 @@ BdsLibRegisterNewOption (
sizeof (UINT16),
&BootOrderEntry
);
- FreePool (TempOptionPtr);
+ if (TempOptionPtr != NULL) {
+ FreePool (TempOptionPtr);
+ }
return Status;
}