Buffer\r
);\r
\r
- SafeFreePool (Buffer);\r
+ FreePool (Buffer);\r
+ \r
Buffer = NULL;\r
\r
NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16));\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- if (NULL != *BootOrderList) {\r
+ if (*BootOrderList != NULL) {\r
CopyMem (NewBootOrderList, *BootOrderList, *BootOrderListSize);\r
+ FreePool (*BootOrderList);\r
}\r
\r
- SafeFreePool (*BootOrderList);\r
-\r
BootOrderLastIndex = (UINTN) (*BootOrderListSize / sizeof (UINT16));\r
NewBootOrderList[BootOrderLastIndex] = CurrentBootOptionNo;\r
*BootOrderListSize += sizeof (UINT16);\r
&BootOptionSize\r
);\r
if (NULL == BootOptionVar) {\r
- SafeFreePool (BootOrder);\r
+ if (BootOrder != NULL) {\r
+ FreePool (BootOrder);\r
+ }\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
// Skip Non-Legacy boot options\r
// \r
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, &BbsIndex)) {\r
- SafeFreePool (BootOptionVar);\r
+ if (BootOptionVar!= NULL) {\r
+ FreePool (BootOptionVar);\r
+ }\r
Index++;\r
continue;\r
}\r
continue;\r
}\r
\r
- SafeFreePool (BootOptionVar);\r
+ if (BootOptionVar != NULL) {\r
+ FreePool (BootOptionVar);\r
+ }\r
//\r
// should delete\r
//\r
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);\r
}\r
\r
- SafeFreePool (BootOrder);\r
+ if (BootOrder != NULL) {\r
+ FreePool (BootOrder);\r
+ }\r
\r
return Status;\r
}\r
// Skip Non-legacy boot option\r
//\r
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, BbsIndex)) {\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
continue;\r
}\r
\r
if (BbsEntry->DeviceType != DevType) {\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
continue;\r
}\r
\r
*Attribute = *(UINT32 *) BootOptionVar;\r
*OptionNumber = Index;\r
Found = TRUE;\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
break;\r
}\r
\r
}\r
\r
if (BootOrder != NULL) {\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
}\r
\r
return Status;\r
TotalSize,\r
DevOrder\r
);\r
- SafeFreePool (DevOrder);\r
+ FreePool (DevOrder);\r
\r
return Status;\r
}\r
}\r
}\r
\r
- SafeFreePool (DevOrder);\r
+ FreePool (DevOrder);\r
\r
Status = gRT->SetVariable (\r
VAR_LEGACY_DEV_ORDER,\r
TotalSize,\r
NewDevOrder\r
);\r
- SafeFreePool (NewDevOrder);\r
+ FreePool (NewDevOrder);\r
\r
return Status;\r
}\r
}\r
\r
if (DevOrder >= OrigBuffer + DevOrderSize) {\r
- SafeFreePool (OrigBuffer);\r
+ FreePool (OrigBuffer);\r
return EFI_NOT_FOUND;\r
}\r
\r
}\r
}\r
\r
- SafeFreePool (OrigBuffer);\r
+ FreePool (OrigBuffer);\r
return EFI_SUCCESS;\r
}\r
\r
Ptr += StrSize ((UINT16 *) Ptr);\r
DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;\r
if (BBS_DEVICE_PATH != DevPath->Type || BBS_BBS_DP != DevPath->SubType) {\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
continue;\r
}\r
\r
//\r
// We don't want to process twice for a device type\r
//\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
continue;\r
}\r
\r
LocalBbsTable,\r
&Priority\r
);\r
- SafeFreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
if (EFI_ERROR (Status)) {\r
break;\r
}\r
}\r
\r
if (BootOrder != NULL) {\r
- SafeFreePool (BootOrder);\r
+ FreePool (BootOrder);\r
}\r
//\r
// For debug\r