diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-10-31 06:35:23 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-10-31 06:35:23 +0000 |
commit | c473cc175602bb2c9aa02636c6a8b560d935130f (patch) | |
tree | 9e8e1ca30ad39525b27f3f161633a853313b1998 /MdeModulePkg/Library/GenericBdsLib | |
parent | f7763aa493ec73f2f1352b4123da55d333b296dd (diff) | |
download | edk2-platforms-c473cc175602bb2c9aa02636c6a8b560d935130f.tar.xz |
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/GenericBdsLib')
-rw-r--r-- | MdeModulePkg/Library/GenericBdsLib/BdsMisc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c index 994f90ed0d..3136341162 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;
}
|