diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-06 08:41:58 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-06 08:41:58 +0000 |
commit | 2d1f3dd497f343bc54b4a164d4e9f015ae04f7dc (patch) | |
tree | c898ba3e282ebeed9d8da62b66bdd43ef540acab /IntelFrameworkModulePkg/Universal/BdsDxe | |
parent | d6f19057f048bdb1afb84fb8dddcb6373c0b684f (diff) | |
download | edk2-platforms-2d1f3dd497f343bc54b4a164d4e9f015ae04f7dc.tar.xz |
Fix memory leak issues.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13428 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c index 7879e18a41..db0fed5834 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c @@ -76,6 +76,8 @@ OrderLegacyBootOption4SameType ( *EnBootOptionCount = 0;
Index = 0;
+ ASSERT (BbsIndexArray != NULL);
+ ASSERT (DeviceTypeArray != NULL);
ASSERT (*EnBootOption != NULL);
ASSERT (*DisBootOption != NULL);
@@ -84,7 +86,7 @@ OrderLegacyBootOption4SameType ( UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);
InitializeListHead (&List);
BootOption = BdsLibVariableToOption (&List, OptionName);
- ASSERT_EFI_ERROR (BootOption != NULL);
+ ASSERT (BootOption != NULL);
if ((DevicePathType (BootOption->DevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (BootOption->DevicePath) == BBS_BBS_DP)) {
@@ -111,6 +113,7 @@ OrderLegacyBootOption4SameType ( //
StartPosition = BootOrderSize / sizeof (UINT16);
NewBootOption = AllocatePool (DevOrderCount * sizeof (UINT16));
+ ASSERT (NewBootOption != NULL);
while (DevOrderCount-- != 0) {
for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
if (BbsIndexArray[Index] == (DevOrder[DevOrderCount] & 0xFF)) {
@@ -191,7 +194,7 @@ GroupMultipleLegacyBootOption4SameType ( UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);
InitializeListHead (&List);
BootOption = BdsLibVariableToOption (&List, OptionName);
- ASSERT_EFI_ERROR (BootOption != NULL);
+ ASSERT (BootOption != NULL);
if ((DevicePathType (BootOption->DevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (BootOption->DevicePath) == BBS_BBS_DP)) {
|