mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 00:24:07 +02:00
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its implementation only check if a pointer is NULL. If a garbage pointer is passed in, the gBS->FreePool will still ASSERT in debug build and return error code.
It is recommended that module writer should keep track how a pointer is allocated and free it after use. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6306 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bb1d8ee669
commit
676df92c2c
@ -651,7 +651,9 @@ ReleaseKeyboardLayoutResources (
|
|||||||
USB_NS_KEY *UsbNsKey;
|
USB_NS_KEY *UsbNsKey;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
|
|
||||||
SafeFreePool (UsbKeyboardDevice->KeyConvertionTable);
|
if (UsbKeyboardDevice->KeyConvertionTable != NULL) {
|
||||||
|
FreePool (UsbKeyboardDevice->KeyConvertionTable);
|
||||||
|
}
|
||||||
UsbKeyboardDevice->KeyConvertionTable = NULL;
|
UsbKeyboardDevice->KeyConvertionTable = NULL;
|
||||||
|
|
||||||
while (!IsListEmpty (&UsbKeyboardDevice->NsKeyList)) {
|
while (!IsListEmpty (&UsbKeyboardDevice->NsKeyList)) {
|
||||||
@ -659,8 +661,8 @@ ReleaseKeyboardLayoutResources (
|
|||||||
UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link);
|
UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link);
|
||||||
RemoveEntryList (&UsbNsKey->Link);
|
RemoveEntryList (&UsbNsKey->Link);
|
||||||
|
|
||||||
gBS->FreePool (UsbNsKey->NsKey);
|
FreePool (UsbNsKey->NsKey);
|
||||||
gBS->FreePool (UsbNsKey);
|
FreePool (UsbNsKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ BdsLibBootViaBootOption (
|
|||||||
Status = BdsLibUpdateFvFileDevicePath (&DevicePath, &gEfiShellFileGuid);
|
Status = BdsLibUpdateFvFileDevicePath (&DevicePath, &gEfiShellFileGuid);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
if (Option->DevicePath != NULL) {
|
if (Option->DevicePath != NULL) {
|
||||||
SafeFreePool(Option->DevicePath);
|
FreePool(Option->DevicePath);
|
||||||
}
|
}
|
||||||
Option->DevicePath = AllocateZeroPool (GetDevicePathSize (DevicePath));
|
Option->DevicePath = AllocateZeroPool (GetDevicePathSize (DevicePath));
|
||||||
CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath));
|
CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath));
|
||||||
@ -186,7 +186,7 @@ BdsLibBootViaBootOption (
|
|||||||
//
|
//
|
||||||
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()
|
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()
|
||||||
//
|
//
|
||||||
SafeFreePool (DevicePath);
|
FreePool (DevicePath);
|
||||||
DevicePath = Option->DevicePath;
|
DevicePath = Option->DevicePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
// Come here means the first instance is not matched
|
// Come here means the first instance is not matched
|
||||||
//
|
//
|
||||||
NeedAdjust = TRUE;
|
NeedAdjust = TRUE;
|
||||||
SafeFreePool(Instance);
|
FreePool(Instance);
|
||||||
} while (TempNewDevicePath != NULL);
|
} while (TempNewDevicePath != NULL);
|
||||||
|
|
||||||
if (DeviceExist) {
|
if (DeviceExist) {
|
||||||
@ -378,14 +378,14 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
//
|
//
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );
|
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );
|
||||||
SafeFreePool (TempNewDevicePath);
|
FreePool (TempNewDevicePath);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Second, append the remaining parth after the matched instance
|
// Second, append the remaining parth after the matched instance
|
||||||
//
|
//
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = AppendDevicePathInstance (Instance, CachedDevicePath );
|
CachedDevicePath = AppendDevicePathInstance (Instance, CachedDevicePath );
|
||||||
SafeFreePool (TempNewDevicePath);
|
FreePool (TempNewDevicePath);
|
||||||
//
|
//
|
||||||
// Save the matching Device Path so we don't need to do a connect all next time
|
// Save the matching Device Path so we don't need to do a connect all next time
|
||||||
//
|
//
|
||||||
@ -398,8 +398,8 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Instance);
|
FreePool (Instance);
|
||||||
SafeFreePool (CachedDevicePath);
|
FreePool (CachedDevicePath);
|
||||||
return FullDevicePath;
|
return FullDevicePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,15 +444,15 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
if (BdsLibMatchDevicePaths (CachedDevicePath, BlockIoDevicePath)) {
|
if (BdsLibMatchDevicePaths (CachedDevicePath, BlockIoDevicePath)) {
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);
|
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);
|
||||||
SafeFreePool(TempNewDevicePath);
|
FreePool(TempNewDevicePath);
|
||||||
|
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
|
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
|
||||||
SafeFreePool(TempNewDevicePath);
|
FreePool(TempNewDevicePath);
|
||||||
} else {
|
} else {
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
|
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
|
||||||
SafeFreePool(TempNewDevicePath);
|
FreePool(TempNewDevicePath);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller
|
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller
|
||||||
@ -496,8 +496,10 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (CachedDevicePath);
|
FreePool (CachedDevicePath);
|
||||||
SafeFreePool (BlockIoBuffer);
|
if (BlockIoBuffer != NULL) {
|
||||||
|
FreePool (BlockIoBuffer);
|
||||||
|
}
|
||||||
return FullDevicePath;
|
return FullDevicePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,7 +651,7 @@ BdsLibDeleteOptionFromHandle (
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (BootOptionVar == NULL) {
|
if (BootOptionVar == NULL) {
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,11 +667,11 @@ BdsLibDeleteOptionFromHandle (
|
|||||||
if ((OptionDevicePathSize == DevicePathSize) &&
|
if ((OptionDevicePathSize == DevicePathSize) &&
|
||||||
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {
|
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {
|
||||||
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);
|
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -684,7 +686,7 @@ BdsLibDeleteOptionFromHandle (
|
|||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -741,7 +743,7 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
&BootOptionSize
|
&BootOptionSize
|
||||||
);
|
);
|
||||||
if (NULL == BootOptionVar) {
|
if (NULL == BootOptionVar) {
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -755,7 +757,7 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
//
|
//
|
||||||
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&
|
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&
|
||||||
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {
|
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
Index++;
|
Index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -777,7 +779,7 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
BootOrder[Index] = 0xffff;
|
BootOrder[Index] = 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,7 +801,7 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -963,7 +965,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NumberBlockIoHandles != 0) {
|
if (NumberBlockIoHandles != 0) {
|
||||||
SafeFreePool (BlockIoHandles);
|
FreePool (BlockIoHandles);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1025,7 +1027,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NumberFileSystemHandles != 0) {
|
if (NumberFileSystemHandles != 0) {
|
||||||
SafeFreePool (FileSystemHandles);
|
FreePool (FileSystemHandles);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1048,7 +1050,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NumberSimpleNetworkHandles != 0) {
|
if (NumberSimpleNetworkHandles != 0) {
|
||||||
SafeFreePool (SimpleNetworkHandles);
|
FreePool (SimpleNetworkHandles);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1102,7 +1104,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FvHandleCount != 0) {
|
if (FvHandleCount != 0) {
|
||||||
SafeFreePool (FvHandleBuffer);
|
FreePool (FvHandleBuffer);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Make sure every boot only have one time
|
// Make sure every boot only have one time
|
||||||
@ -1307,7 +1309,7 @@ BdsLibGetBootableHandle (
|
|||||||
BlockIo->Media->BlockSize,
|
BlockIo->Media->BlockSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
SafeFreePool(Buffer);
|
FreePool(Buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1320,6 +1322,8 @@ BdsLibGetBootableHandle (
|
|||||||
// Try to locate the USB node device path first, if fail then use its previour PCI node to search
|
// Try to locate the USB node device path first, if fail then use its previour PCI node to search
|
||||||
//
|
//
|
||||||
DupDevicePath = DuplicateDevicePath (DevicePath);
|
DupDevicePath = DuplicateDevicePath (DevicePath);
|
||||||
|
ASSERT (DupDevicePath != NULL);
|
||||||
|
|
||||||
UpdatedDevicePath = DupDevicePath;
|
UpdatedDevicePath = DupDevicePath;
|
||||||
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);
|
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);
|
||||||
//
|
//
|
||||||
@ -1379,9 +1383,11 @@ BdsLibGetBootableHandle (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool(DupDevicePath);
|
FreePool(DupDevicePath);
|
||||||
|
|
||||||
SafeFreePool(SimpleFileSystemHandles);
|
if (SimpleFileSystemHandles != NULL) {
|
||||||
|
FreePool(SimpleFileSystemHandles);
|
||||||
|
}
|
||||||
|
|
||||||
return ReturnHandle;
|
return ReturnHandle;
|
||||||
}
|
}
|
||||||
@ -1640,7 +1646,7 @@ BdsLibIsValidEFIBootOptDevicePath (
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (Status == EFI_SUCCESS) {
|
if (Status == EFI_SUCCESS) {
|
||||||
SafeFreePool (TempDevicePath);
|
FreePool (TempDevicePath);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1885,8 +1891,10 @@ BdsLibUpdateFvFileDevicePath (
|
|||||||
FoundFvHandle = FvHandleBuffer[Index];
|
FoundFvHandle = FvHandleBuffer[Index];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (FvHandleBuffer);
|
if (FvHandleBuffer != NULL) {
|
||||||
|
FreePool (FvHandleBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FindFvFile) {
|
if (FindFvFile) {
|
||||||
|
@ -176,7 +176,7 @@ BdsLibConnectDevicePath (
|
|||||||
} while (DevicePath != NULL);
|
} while (DevicePath != NULL);
|
||||||
|
|
||||||
if (CopyOfDevicePath != NULL) {
|
if (CopyOfDevicePath != NULL) {
|
||||||
SafeFreePool (CopyOfDevicePath);
|
FreePool (CopyOfDevicePath);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// All handle with DevicePath exists in the handle database
|
// All handle with DevicePath exists in the handle database
|
||||||
@ -220,7 +220,9 @@ BdsLibConnectAllEfi (
|
|||||||
Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
|
Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (HandleBuffer);
|
if (HandleBuffer != NULL) {
|
||||||
|
FreePool (HandleBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -263,7 +265,9 @@ BdsLibDisconnectAllEfi (
|
|||||||
Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
|
Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (HandleBuffer);
|
if (HandleBuffer != NULL) {
|
||||||
|
FreePool (HandleBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,9 @@ BdsLibUpdateConsoleVariable (
|
|||||||
//
|
//
|
||||||
TempNewDevicePath = NewDevicePath;
|
TempNewDevicePath = NewDevicePath;
|
||||||
NewDevicePath = AppendDevicePathInstance (NewDevicePath, CustomizedConDevicePath);
|
NewDevicePath = AppendDevicePathInstance (NewDevicePath, CustomizedConDevicePath);
|
||||||
SafeFreePool(TempNewDevicePath);
|
if (TempNewDevicePath != NULL) {
|
||||||
|
FreePool(TempNewDevicePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,10 +159,16 @@ BdsLibUpdateConsoleVariable (
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (VarConsole == NewDevicePath) {
|
if (VarConsole == NewDevicePath) {
|
||||||
SafeFreePool(VarConsole);
|
if (VarConsole != NULL) {
|
||||||
|
FreePool(VarConsole);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SafeFreePool(VarConsole);
|
if (VarConsole != NULL) {
|
||||||
SafeFreePool(NewDevicePath);
|
FreePool(VarConsole);
|
||||||
|
}
|
||||||
|
if (NewDevicePath) {
|
||||||
|
FreePool(NewDevicePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -258,10 +266,10 @@ BdsLibConnectConsoleVariable (
|
|||||||
DeviceExist = TRUE;
|
DeviceExist = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SafeFreePool(Instance);
|
FreePool(Instance);
|
||||||
} while (CopyOfDevicePath != NULL);
|
} while (CopyOfDevicePath != NULL);
|
||||||
|
|
||||||
SafeFreePool (StartDevicePath);
|
FreePool (StartDevicePath);
|
||||||
|
|
||||||
if (!DeviceExist) {
|
if (!DeviceExist) {
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
@ -312,7 +320,10 @@ BdsLibConnectAllConsoles (
|
|||||||
BdsLibUpdateConsoleVariable (L"ConIn", ConDevicePath, NULL);
|
BdsLibUpdateConsoleVariable (L"ConIn", ConDevicePath, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool(HandleBuffer);
|
if (HandleBuffer != NULL) {
|
||||||
|
FreePool(HandleBuffer);
|
||||||
|
HandleBuffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
gBS->LocateHandleBuffer (
|
gBS->LocateHandleBuffer (
|
||||||
ByProtocol,
|
ByProtocol,
|
||||||
@ -331,7 +342,9 @@ BdsLibConnectAllConsoles (
|
|||||||
BdsLibUpdateConsoleVariable (L"ErrOut", ConDevicePath, NULL);
|
BdsLibUpdateConsoleVariable (L"ErrOut", ConDevicePath, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool(HandleBuffer);
|
if (HandleBuffer != NULL) {
|
||||||
|
FreePool(HandleBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Connect all console variables
|
// Connect all console variables
|
||||||
|
@ -304,25 +304,27 @@ BdsLibRegisterNewOption (
|
|||||||
//
|
//
|
||||||
// Got the option, so just return
|
// Got the option, so just return
|
||||||
//
|
//
|
||||||
SafeFreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
SafeFreePool (TempOptionPtr);
|
FreePool (TempOptionPtr);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// Option description changed, need update.
|
// Option description changed, need update.
|
||||||
//
|
//
|
||||||
UpdateDescription = TRUE;
|
UpdateDescription = TRUE;
|
||||||
SafeFreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String);
|
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String);
|
||||||
OptionSize += GetDevicePathSize (DevicePath);
|
OptionSize += GetDevicePathSize (DevicePath);
|
||||||
OptionPtr = AllocateZeroPool (OptionSize);
|
OptionPtr = AllocateZeroPool (OptionSize);
|
||||||
|
ASSERT (OptionPtr != NULL);
|
||||||
|
|
||||||
TempPtr = OptionPtr;
|
TempPtr = OptionPtr;
|
||||||
*(UINT32 *) TempPtr = LOAD_OPTION_ACTIVE;
|
*(UINT32 *) TempPtr = LOAD_OPTION_ACTIVE;
|
||||||
TempPtr += sizeof (UINT32);
|
TempPtr += sizeof (UINT32);
|
||||||
@ -361,12 +363,12 @@ BdsLibRegisterNewOption (
|
|||||||
// Return if only need to update a changed description or fail to set option.
|
// Return if only need to update a changed description or fail to set option.
|
||||||
//
|
//
|
||||||
if (EFI_ERROR (Status) || UpdateDescription) {
|
if (EFI_ERROR (Status) || UpdateDescription) {
|
||||||
SafeFreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
SafeFreePool (TempOptionPtr);
|
FreePool (TempOptionPtr);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update the option order variable
|
// Update the option order variable
|
||||||
@ -384,7 +386,7 @@ BdsLibRegisterNewOption (
|
|||||||
sizeof (UINT16),
|
sizeof (UINT16),
|
||||||
&BootOrderEntry
|
&BootOrderEntry
|
||||||
);
|
);
|
||||||
SafeFreePool (TempOptionPtr);
|
FreePool (TempOptionPtr);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,6 +395,8 @@ BdsLibRegisterNewOption (
|
|||||||
//
|
//
|
||||||
OrderItemNum = (TempOptionSize / sizeof (UINT16)) + 1 ;
|
OrderItemNum = (TempOptionSize / sizeof (UINT16)) + 1 ;
|
||||||
OptionOrderPtr = AllocateZeroPool ( OrderItemNum * sizeof (UINT16));
|
OptionOrderPtr = AllocateZeroPool ( OrderItemNum * sizeof (UINT16));
|
||||||
|
ASSERT (OptionOrderPtr!= NULL);
|
||||||
|
|
||||||
CopyMem (OptionOrderPtr, TempOptionPtr, (OrderItemNum - 1) * sizeof (UINT16));
|
CopyMem (OptionOrderPtr, TempOptionPtr, (OrderItemNum - 1) * sizeof (UINT16));
|
||||||
|
|
||||||
OptionOrderPtr[Index] = RegisterOptionNumber;
|
OptionOrderPtr[Index] = RegisterOptionNumber;
|
||||||
@ -404,8 +408,8 @@ BdsLibRegisterNewOption (
|
|||||||
OrderItemNum * sizeof (UINT16),
|
OrderItemNum * sizeof (UINT16),
|
||||||
OptionOrderPtr
|
OptionOrderPtr
|
||||||
);
|
);
|
||||||
SafeFreePool (TempOptionPtr);
|
FreePool (TempOptionPtr);
|
||||||
SafeFreePool (OptionOrderPtr);
|
FreePool (OptionOrderPtr);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -525,12 +529,12 @@ BdsLibVariableToOption (
|
|||||||
//
|
//
|
||||||
if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {
|
if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {
|
||||||
InsertTailList (BdsCommonOptionList, &Option->Link);
|
InsertTailList (BdsCommonOptionList, &Option->Link);
|
||||||
SafeFreePool (Variable);
|
FreePool (Variable);
|
||||||
return Option;
|
return Option;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Variable);
|
FreePool (Variable);
|
||||||
SafeFreePool (Option);
|
FreePool (Option);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -591,7 +595,7 @@ BdsLibBuildOptionFromVar (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OptionOrder);
|
FreePool (OptionOrder);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -716,9 +720,11 @@ BdsLibDelPartMatchInstance (
|
|||||||
//
|
//
|
||||||
TempNewDevicePath = NewDevicePath;
|
TempNewDevicePath = NewDevicePath;
|
||||||
NewDevicePath = AppendDevicePathInstance (NewDevicePath, Instance);
|
NewDevicePath = AppendDevicePathInstance (NewDevicePath, Instance);
|
||||||
SafeFreePool(TempNewDevicePath);
|
if (TempNewDevicePath != NULL) {
|
||||||
|
FreePool(TempNewDevicePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SafeFreePool(Instance);
|
FreePool(Instance);
|
||||||
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
|
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
|
||||||
InstanceSize -= END_DEVICE_PATH_LENGTH;
|
InstanceSize -= END_DEVICE_PATH_LENGTH;
|
||||||
}
|
}
|
||||||
@ -766,11 +772,11 @@ BdsLibMatchDevicePaths (
|
|||||||
// return success
|
// return success
|
||||||
//
|
//
|
||||||
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
||||||
SafeFreePool (DevicePathInst);
|
FreePool (DevicePathInst);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DevicePathInst);
|
FreePool (DevicePathInst);
|
||||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -952,8 +958,8 @@ SetupResetReminder (
|
|||||||
IfrLibCreatePopUp (2, &Key, StringBuffer1, StringBuffer2);
|
IfrLibCreatePopUp (2, &Key, StringBuffer1, StringBuffer2);
|
||||||
} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
|
} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
|
||||||
|
|
||||||
SafeFreePool (StringBuffer1);
|
FreePool (StringBuffer1);
|
||||||
SafeFreePool (StringBuffer2);
|
FreePool (StringBuffer2);
|
||||||
//
|
//
|
||||||
// If the user hits the YES Response key, reset
|
// If the user hits the YES Response key, reset
|
||||||
//
|
//
|
||||||
@ -1014,7 +1020,7 @@ BdsLibGetImageHeader (
|
|||||||
&Root
|
&Root
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
Root = NULL;
|
Root = NULL;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1043,13 +1049,14 @@ BdsLibGetImageHeader (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||||
|
FreePool (Info);
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
SafeFreePool (Info);
|
FreePool (Info);
|
||||||
} while (TRUE);
|
} while (TRUE);
|
||||||
|
|
||||||
FileSize = Info->FileSize;
|
FileSize = Info->FileSize;
|
||||||
SafeFreePool (Info);
|
FreePool (Info);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read dos header
|
// Read dos header
|
||||||
|
@ -45,7 +45,7 @@ ReallocatePool (
|
|||||||
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
|
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OldPool);
|
FreePool (OldPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewPool;
|
return NewPool;
|
||||||
@ -108,7 +108,7 @@ CatPrint (
|
|||||||
Str->len = StringSize - sizeof (UINT16);
|
Str->len = StringSize - sizeof (UINT16);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (AppendStr);
|
FreePool (AppendStr);
|
||||||
return Str->str;
|
return Str->str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1594,7 +1594,7 @@ DevicePathToStr (
|
|||||||
//
|
//
|
||||||
// Shrink pool used for string allocation
|
// Shrink pool used for string allocation
|
||||||
//
|
//
|
||||||
SafeFreePool (DevPath);
|
FreePool (DevPath);
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
NewSize = (Str.len + 1) * sizeof (CHAR16);
|
NewSize = (Str.len + 1) * sizeof (CHAR16);
|
||||||
|
@ -467,7 +467,9 @@ EnableQuietBootEx (
|
|||||||
// Currently only support BMP format.
|
// Currently only support BMP format.
|
||||||
//
|
//
|
||||||
if (Format != EfiBadgingFormatBMP) {
|
if (Format != EfiBadgingFormatBMP) {
|
||||||
SafeFreePool (ImageData);
|
if (ImageData != NULL) {
|
||||||
|
FreePool (ImageData);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -494,7 +496,9 @@ EnableQuietBootEx (
|
|||||||
&Width
|
&Width
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (ImageData);
|
if (ImageData != NULL) {
|
||||||
|
FreePool (ImageData);
|
||||||
|
}
|
||||||
if (Badging == NULL) {
|
if (Badging == NULL) {
|
||||||
return Status;
|
return Status;
|
||||||
} else {
|
} else {
|
||||||
@ -589,8 +593,12 @@ EnableQuietBootEx (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (ImageData);
|
if (ImageData != NULL) {
|
||||||
SafeFreePool (Blt);
|
FreePool (ImageData);
|
||||||
|
}
|
||||||
|
if (Blt != NULL) {
|
||||||
|
FreePool (Blt);
|
||||||
|
}
|
||||||
|
|
||||||
if (Badging == NULL) {
|
if (Badging == NULL) {
|
||||||
break;
|
break;
|
||||||
@ -780,8 +788,8 @@ Print (
|
|||||||
|
|
||||||
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||||
if (Blt->Image.Bitmap == NULL) {
|
if (Blt->Image.Bitmap == NULL) {
|
||||||
SafeFreePool (Blt);
|
FreePool (Blt);
|
||||||
SafeFreePool (Buffer);
|
FreePool (Buffer);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,15 +832,23 @@ Print (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (RowInfoArray);
|
if (RowInfoArray != NULL) {
|
||||||
SafeFreePool (Blt->Image.Bitmap);
|
FreePool (RowInfoArray);
|
||||||
|
}
|
||||||
|
if (Blt->Image.Bitmap != NULL) {
|
||||||
|
FreePool (Blt->Image.Bitmap);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Error:
|
Error:
|
||||||
SafeFreePool (Blt);
|
if (Blt != NULL) {
|
||||||
SafeFreePool (FontInfo);
|
FreePool (Blt);
|
||||||
|
}
|
||||||
|
if (FontInfo != NULL) {
|
||||||
|
FreePool (FontInfo);
|
||||||
|
}
|
||||||
FreePool (Buffer);
|
FreePool (Buffer);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
@ -324,7 +324,8 @@ BdsCreateLegacyBootOption (
|
|||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (Buffer);
|
FreePool (Buffer);
|
||||||
|
|
||||||
Buffer = NULL;
|
Buffer = NULL;
|
||||||
|
|
||||||
NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16));
|
NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16));
|
||||||
@ -334,12 +335,11 @@ BdsCreateLegacyBootOption (
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != *BootOrderList) {
|
if (*BootOrderList != NULL) {
|
||||||
CopyMem (NewBootOrderList, *BootOrderList, *BootOrderListSize);
|
CopyMem (NewBootOrderList, *BootOrderList, *BootOrderListSize);
|
||||||
|
FreePool (*BootOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (*BootOrderList);
|
|
||||||
|
|
||||||
BootOrderLastIndex = (UINTN) (*BootOrderListSize / sizeof (UINT16));
|
BootOrderLastIndex = (UINTN) (*BootOrderListSize / sizeof (UINT16));
|
||||||
NewBootOrderList[BootOrderLastIndex] = CurrentBootOptionNo;
|
NewBootOrderList[BootOrderLastIndex] = CurrentBootOptionNo;
|
||||||
*BootOrderListSize += sizeof (UINT16);
|
*BootOrderListSize += sizeof (UINT16);
|
||||||
@ -462,7 +462,9 @@ BdsDeleteAllInvalidLegacyBootOptions (
|
|||||||
&BootOptionSize
|
&BootOptionSize
|
||||||
);
|
);
|
||||||
if (NULL == BootOptionVar) {
|
if (NULL == BootOptionVar) {
|
||||||
SafeFreePool (BootOrder);
|
if (BootOrder != NULL) {
|
||||||
|
FreePool (BootOrder);
|
||||||
|
}
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,7 +472,9 @@ BdsDeleteAllInvalidLegacyBootOptions (
|
|||||||
// Skip Non-Legacy boot options
|
// Skip Non-Legacy boot options
|
||||||
//
|
//
|
||||||
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, &BbsIndex)) {
|
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, &BbsIndex)) {
|
||||||
SafeFreePool (BootOptionVar);
|
if (BootOptionVar!= NULL) {
|
||||||
|
FreePool (BootOptionVar);
|
||||||
|
}
|
||||||
Index++;
|
Index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -499,7 +503,9 @@ BdsDeleteAllInvalidLegacyBootOptions (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BootOptionVar);
|
if (BootOptionVar != NULL) {
|
||||||
|
FreePool (BootOptionVar);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// should delete
|
// should delete
|
||||||
//
|
//
|
||||||
@ -525,7 +531,9 @@ BdsDeleteAllInvalidLegacyBootOptions (
|
|||||||
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BootOrder);
|
if (BootOrder != NULL) {
|
||||||
|
FreePool (BootOrder);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -588,19 +596,19 @@ BdsFindLegacyBootOptionByDevType (
|
|||||||
// Skip Non-legacy boot option
|
// Skip Non-legacy boot option
|
||||||
//
|
//
|
||||||
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, BbsIndex)) {
|
if (!BdsIsLegacyBootOption (BootOptionVar, &BbsEntry, BbsIndex)) {
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BbsEntry->DeviceType != DevType) {
|
if (BbsEntry->DeviceType != DevType) {
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
*Attribute = *(UINT32 *) BootOptionVar;
|
*Attribute = *(UINT32 *) BootOptionVar;
|
||||||
*OptionNumber = Index;
|
*OptionNumber = Index;
|
||||||
Found = TRUE;
|
Found = TRUE;
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,7 +775,7 @@ BdsAddNonExistingLegacyBootOptions (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BootOrder != NULL) {
|
if (BootOrder != NULL) {
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -952,7 +960,7 @@ BdsCreateDevOrder (
|
|||||||
TotalSize,
|
TotalSize,
|
||||||
DevOrder
|
DevOrder
|
||||||
);
|
);
|
||||||
SafeFreePool (DevOrder);
|
FreePool (DevOrder);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1382,7 +1390,7 @@ BdsUpdateLegacyDevOrder (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DevOrder);
|
FreePool (DevOrder);
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
VAR_LEGACY_DEV_ORDER,
|
VAR_LEGACY_DEV_ORDER,
|
||||||
@ -1391,7 +1399,7 @@ BdsUpdateLegacyDevOrder (
|
|||||||
TotalSize,
|
TotalSize,
|
||||||
NewDevOrder
|
NewDevOrder
|
||||||
);
|
);
|
||||||
SafeFreePool (NewDevOrder);
|
FreePool (NewDevOrder);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1442,7 +1450,7 @@ BdsSetBootPriority4SameTypeDev (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DevOrder >= OrigBuffer + DevOrderSize) {
|
if (DevOrder >= OrigBuffer + DevOrderSize) {
|
||||||
SafeFreePool (OrigBuffer);
|
FreePool (OrigBuffer);
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1463,7 +1471,7 @@ BdsSetBootPriority4SameTypeDev (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OrigBuffer);
|
FreePool (OrigBuffer);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1619,7 +1627,7 @@ BdsRefreshBbsTableForBoot (
|
|||||||
Ptr += StrSize ((UINT16 *) Ptr);
|
Ptr += StrSize ((UINT16 *) Ptr);
|
||||||
DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
|
DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
|
||||||
if (BBS_DEVICE_PATH != DevPath->Type || BBS_BBS_DP != DevPath->SubType) {
|
if (BBS_DEVICE_PATH != DevPath->Type || BBS_BBS_DP != DevPath->SubType) {
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1628,7 +1636,7 @@ BdsRefreshBbsTableForBoot (
|
|||||||
//
|
//
|
||||||
// We don't want to process twice for a device type
|
// We don't want to process twice for a device type
|
||||||
//
|
//
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1637,14 +1645,14 @@ BdsRefreshBbsTableForBoot (
|
|||||||
LocalBbsTable,
|
LocalBbsTable,
|
||||||
&Priority
|
&Priority
|
||||||
);
|
);
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BootOrder != NULL) {
|
if (BootOrder != NULL) {
|
||||||
SafeFreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// For debug
|
// For debug
|
||||||
|
@ -125,7 +125,9 @@ EfiGrowBuffer (
|
|||||||
TryAgain = FALSE;
|
TryAgain = FALSE;
|
||||||
if (*Status == EFI_BUFFER_TOO_SMALL) {
|
if (*Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
|
|
||||||
SafeFreePool (*Buffer);
|
if (*Buffer != NULL) {
|
||||||
|
FreePool (*Buffer);
|
||||||
|
}
|
||||||
|
|
||||||
*Buffer = AllocateZeroPool (BufferSize);
|
*Buffer = AllocateZeroPool (BufferSize);
|
||||||
|
|
||||||
@ -139,7 +141,7 @@ EfiGrowBuffer (
|
|||||||
// If there's an error, free the buffer
|
// If there's an error, free the buffer
|
||||||
//
|
//
|
||||||
if (!TryAgain && EFI_ERROR (*Status) && (*Buffer != NULL)) {
|
if (!TryAgain && EFI_ERROR (*Status) && (*Buffer != NULL)) {
|
||||||
SafeFreePool (*Buffer);
|
FreePool (*Buffer);
|
||||||
*Buffer = NULL;
|
*Buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +203,7 @@ EfiLibDeleteVariable (
|
|||||||
//
|
//
|
||||||
Status = gRT->SetVariable (VarName, VarGuid, VAR_FLAG, 0, NULL);
|
Status = gRT->SetVariable (VarName, VarGuid, VAR_FLAG, 0, NULL);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
ASSERT (!EFI_ERROR (Status));
|
||||||
SafeFreePool (VarBuf);
|
FreePool (VarBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -373,7 +375,7 @@ EfiReallocatePool (
|
|||||||
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
|
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OldPool);
|
FreePool (OldPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewPool;
|
return NewPool;
|
||||||
|
@ -811,7 +811,7 @@ InitializeBM (
|
|||||||
//
|
//
|
||||||
Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
|
Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
|
||||||
if (Ptr == NULL) {
|
if (Ptr == NULL) {
|
||||||
SafeFreePool (BmmCallbackInfo);
|
FreePool (BmmCallbackInfo);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -917,8 +917,8 @@ InitializeBM (
|
|||||||
gUpdateData.BufferSize = UPDATE_DATA_SIZE;
|
gUpdateData.BufferSize = UPDATE_DATA_SIZE;
|
||||||
gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);
|
gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);
|
||||||
if (gUpdateData.Data == NULL) {
|
if (gUpdateData.Data == NULL) {
|
||||||
SafeFreePool (BmmCallbackInfo->LoadContext);
|
FreePool (BmmCallbackInfo->LoadContext);
|
||||||
SafeFreePool (BmmCallbackInfo);
|
FreePool (BmmCallbackInfo);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1020,9 +1020,9 @@ InitializeBM (
|
|||||||
|
|
||||||
FreeAllMenu ();
|
FreeAllMenu ();
|
||||||
|
|
||||||
SafeFreePool (BmmCallbackInfo->LoadContext);
|
FreePool (BmmCallbackInfo->LoadContext);
|
||||||
SafeFreePool (BmmCallbackInfo);
|
FreePool (BmmCallbackInfo);
|
||||||
SafeFreePool (gUpdateData.Data);
|
FreePool (gUpdateData.Data);
|
||||||
gUpdateData.Data = NULL;
|
gUpdateData.Data = NULL;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -1205,7 +1205,7 @@ CleanUpStringDepository (
|
|||||||
CurrentListNode = StringDepository->ListHead;
|
CurrentListNode = StringDepository->ListHead;
|
||||||
for (NodeIndex = 0; NodeIndex < StringDepository->TotalNodeNumber; NodeIndex++) {
|
for (NodeIndex = 0; NodeIndex < StringDepository->TotalNodeNumber; NodeIndex++) {
|
||||||
NextListNode = CurrentListNode->Next;
|
NextListNode = CurrentListNode->Next;
|
||||||
SafeFreePool (CurrentListNode);
|
FreePool (CurrentListNode);
|
||||||
CurrentListNode = NextListNode;
|
CurrentListNode = NextListNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1214,7 +1214,7 @@ CleanUpStringDepository (
|
|||||||
//
|
//
|
||||||
// Release string depository.
|
// Release string depository.
|
||||||
//
|
//
|
||||||
SafeFreePool (FileOptionStrDepository);
|
FreePool (FileOptionStrDepository);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,7 +83,7 @@ BOpt_CreateMenuEntry (
|
|||||||
|
|
||||||
MenuEntry->VariableContext = AllocateZeroPool (ContextSize);
|
MenuEntry->VariableContext = AllocateZeroPool (ContextSize);
|
||||||
if (NULL == MenuEntry->VariableContext) {
|
if (NULL == MenuEntry->VariableContext) {
|
||||||
SafeFreePool (MenuEntry);
|
FreePool (MenuEntry);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,59 +116,65 @@ BOpt_DestroyMenuEntry (
|
|||||||
switch (MenuEntry->ContextSelection) {
|
switch (MenuEntry->ContextSelection) {
|
||||||
case BM_LOAD_CONTEXT_SELECT:
|
case BM_LOAD_CONTEXT_SELECT:
|
||||||
LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext;
|
LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext;
|
||||||
SafeFreePool (LoadContext->FilePathList);
|
FreePool (LoadContext->FilePathList);
|
||||||
SafeFreePool (LoadContext->LoadOption);
|
FreePool (LoadContext->LoadOption);
|
||||||
SafeFreePool (LoadContext->OptionalData);
|
if (LoadContext->OptionalData != NULL) {
|
||||||
SafeFreePool (LoadContext);
|
FreePool (LoadContext->OptionalData);
|
||||||
|
}
|
||||||
|
FreePool (LoadContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_FILE_CONTEXT_SELECT:
|
case BM_FILE_CONTEXT_SELECT:
|
||||||
FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;
|
FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;
|
||||||
|
|
||||||
if (!FileContext->IsRoot) {
|
if (!FileContext->IsRoot) {
|
||||||
SafeFreePool (FileContext->DevicePath);
|
FreePool (FileContext->DevicePath);
|
||||||
} else {
|
} else {
|
||||||
if (FileContext->FHandle != NULL) {
|
if (FileContext->FHandle != NULL) {
|
||||||
FileContext->FHandle->Close (FileContext->FHandle);
|
FileContext->FHandle->Close (FileContext->FHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (FileContext->FileName);
|
if (FileContext->FileName != NULL) {
|
||||||
SafeFreePool (FileContext->Info);
|
FreePool (FileContext->FileName);
|
||||||
SafeFreePool (FileContext);
|
}
|
||||||
|
if (FileContext->Info != NULL) {
|
||||||
|
FreePool (FileContext->Info);
|
||||||
|
}
|
||||||
|
FreePool (FileContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_CONSOLE_CONTEXT_SELECT:
|
case BM_CONSOLE_CONTEXT_SELECT:
|
||||||
ConsoleContext = (BM_CONSOLE_CONTEXT *) MenuEntry->VariableContext;
|
ConsoleContext = (BM_CONSOLE_CONTEXT *) MenuEntry->VariableContext;
|
||||||
SafeFreePool (ConsoleContext->DevicePath);
|
FreePool (ConsoleContext->DevicePath);
|
||||||
SafeFreePool (ConsoleContext);
|
FreePool (ConsoleContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_TERMINAL_CONTEXT_SELECT:
|
case BM_TERMINAL_CONTEXT_SELECT:
|
||||||
TerminalContext = (BM_TERMINAL_CONTEXT *) MenuEntry->VariableContext;
|
TerminalContext = (BM_TERMINAL_CONTEXT *) MenuEntry->VariableContext;
|
||||||
SafeFreePool (TerminalContext->DevicePath);
|
FreePool (TerminalContext->DevicePath);
|
||||||
SafeFreePool (TerminalContext);
|
FreePool (TerminalContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_HANDLE_CONTEXT_SELECT:
|
case BM_HANDLE_CONTEXT_SELECT:
|
||||||
HandleContext = (BM_HANDLE_CONTEXT *) MenuEntry->VariableContext;
|
HandleContext = (BM_HANDLE_CONTEXT *) MenuEntry->VariableContext;
|
||||||
SafeFreePool (HandleContext);
|
FreePool (HandleContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_LEGACY_DEV_CONTEXT_SELECT:
|
case BM_LEGACY_DEV_CONTEXT_SELECT:
|
||||||
LegacyDevContext = (BM_LEGACY_DEVICE_CONTEXT *) MenuEntry->VariableContext;
|
LegacyDevContext = (BM_LEGACY_DEVICE_CONTEXT *) MenuEntry->VariableContext;
|
||||||
SafeFreePool (LegacyDevContext);
|
FreePool (LegacyDevContext);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (MenuEntry->DisplayString);
|
FreePool (MenuEntry->DisplayString);
|
||||||
if (NULL != MenuEntry->HelpString) {
|
if (NULL != MenuEntry->HelpString) {
|
||||||
SafeFreePool (MenuEntry->HelpString);
|
FreePool (MenuEntry->HelpString);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (MenuEntry);
|
FreePool (MenuEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,7 +284,7 @@ BOpt_FindFileSystem (
|
|||||||
if (BlkIo->Media->RemovableMedia) {
|
if (BlkIo->Media->RemovableMedia) {
|
||||||
Buffer = AllocateZeroPool (BlkIo->Media->BlockSize);
|
Buffer = AllocateZeroPool (BlkIo->Media->BlockSize);
|
||||||
if (NULL == Buffer) {
|
if (NULL == Buffer) {
|
||||||
SafeFreePool (BlkIoHandle);
|
FreePool (BlkIoHandle);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,10 +295,10 @@ BOpt_FindFileSystem (
|
|||||||
BlkIo->Media->BlockSize,
|
BlkIo->Media->BlockSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
SafeFreePool (Buffer);
|
FreePool (Buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SafeFreePool (BlkIoHandle);
|
FreePool (BlkIoHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -332,7 +338,7 @@ BOpt_FindFileSystem (
|
|||||||
//
|
//
|
||||||
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
|
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
|
||||||
if (NULL == MenuEntry) {
|
if (NULL == MenuEntry) {
|
||||||
SafeFreePool (SimpleFsHandle);
|
FreePool (SimpleFsHandle);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,7 +396,7 @@ BOpt_FindFileSystem (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NoSimpleFsHandles != 0) {
|
if (NoSimpleFsHandles != 0) {
|
||||||
SafeFreePool (SimpleFsHandle);
|
FreePool (SimpleFsHandle);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Searching for handles that support Load File protocol
|
// Searching for handles that support Load File protocol
|
||||||
@ -407,7 +413,7 @@ BOpt_FindFileSystem (
|
|||||||
for (Index = 0; Index < NoLoadFileHandles; Index++) {
|
for (Index = 0; Index < NoLoadFileHandles; Index++) {
|
||||||
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
|
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
|
||||||
if (NULL == MenuEntry) {
|
if (NULL == MenuEntry) {
|
||||||
SafeFreePool (LoadFileHandle);
|
FreePool (LoadFileHandle);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +444,7 @@ BOpt_FindFileSystem (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NoLoadFileHandles != 0) {
|
if (NoLoadFileHandles != 0) {
|
||||||
SafeFreePool (LoadFileHandle);
|
FreePool (LoadFileHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -676,7 +682,7 @@ BOpt_FindFiles (
|
|||||||
}
|
}
|
||||||
|
|
||||||
DirectoryMenu.MenuNumber = OptionNumber;
|
DirectoryMenu.MenuNumber = OptionNumber;
|
||||||
SafeFreePool (DirInfo);
|
FreePool (DirInfo);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,7 +904,7 @@ BOpt_GetBootOptions (
|
|||||||
|
|
||||||
if (BootNext != NULL) {
|
if (BootNext != NULL) {
|
||||||
if (BootNextSize != sizeof (UINT16)) {
|
if (BootNextSize != sizeof (UINT16)) {
|
||||||
SafeFreePool (BootNext);
|
FreePool (BootNext);
|
||||||
BootNext = NULL;
|
BootNext = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -923,7 +929,7 @@ BOpt_GetBootOptions (
|
|||||||
}
|
}
|
||||||
|
|
||||||
CopyMem (LoadOption, LoadOptionFromVar, BootOptionSize);
|
CopyMem (LoadOption, LoadOptionFromVar, BootOptionSize);
|
||||||
SafeFreePool (LoadOptionFromVar);
|
FreePool (LoadOptionFromVar);
|
||||||
|
|
||||||
if (BootNext != NULL) {
|
if (BootNext != NULL) {
|
||||||
BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]);
|
BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]);
|
||||||
@ -932,7 +938,7 @@ BOpt_GetBootOptions (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (0 == (*((UINT32 *) LoadOption) & LOAD_OPTION_ACTIVE)) {
|
if (0 == (*((UINT32 *) LoadOption) & LOAD_OPTION_ACTIVE)) {
|
||||||
SafeFreePool (LoadOption);
|
FreePool (LoadOption);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -1054,8 +1060,12 @@ BOpt_GetBootOptions (
|
|||||||
MenuCount++;
|
MenuCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BootNext);
|
if (BootNext != NULL) {
|
||||||
SafeFreePool (BootOrderList);
|
FreePool (BootNext);
|
||||||
|
}
|
||||||
|
if (BootOrderList != NULL) {
|
||||||
|
FreePool (BootOrderList);
|
||||||
|
}
|
||||||
BootOptionMenu.MenuNumber = MenuCount;
|
BootOptionMenu.MenuNumber = MenuCount;
|
||||||
return MenuCount;
|
return MenuCount;
|
||||||
}
|
}
|
||||||
@ -1318,7 +1328,7 @@ BOpt_FindDrivers (
|
|||||||
|
|
||||||
NewMenuEntry = BOpt_CreateMenuEntry (BM_HANDLE_CONTEXT_SELECT);
|
NewMenuEntry = BOpt_CreateMenuEntry (BM_HANDLE_CONTEXT_SELECT);
|
||||||
if (NULL == NewMenuEntry) {
|
if (NULL == NewMenuEntry) {
|
||||||
SafeFreePool (DevicePathHandle);
|
FreePool (DevicePathHandle);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1332,7 +1342,10 @@ BOpt_FindDrivers (
|
|||||||
InsertTailList (&DriverMenu.Head, &NewMenuEntry->Link);
|
InsertTailList (&DriverMenu.Head, &NewMenuEntry->Link);
|
||||||
|
|
||||||
}
|
}
|
||||||
SafeFreePool (DevicePathHandle);
|
|
||||||
|
if (DevicePathHandle != NULL) {
|
||||||
|
FreePool (DevicePathHandle);
|
||||||
|
}
|
||||||
|
|
||||||
DriverMenu.MenuNumber = OptionNumber;
|
DriverMenu.MenuNumber = OptionNumber;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1545,7 +1558,7 @@ BOpt_GetDriverOptions (
|
|||||||
}
|
}
|
||||||
|
|
||||||
CopyMem (LoadOption, LoadOptionFromVar, DriverOptionSize);
|
CopyMem (LoadOption, LoadOptionFromVar, DriverOptionSize);
|
||||||
SafeFreePool (LoadOptionFromVar);
|
FreePool (LoadOptionFromVar);
|
||||||
|
|
||||||
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);
|
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);
|
||||||
if (NULL == NewMenuEntry) {
|
if (NULL == NewMenuEntry) {
|
||||||
@ -1631,7 +1644,9 @@ BOpt_GetDriverOptions (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DriverOrderList);
|
if (DriverOrderList != NULL) {
|
||||||
|
FreePool (DriverOrderList);
|
||||||
|
}
|
||||||
DriverOptionMenu.MenuNumber = Index;
|
DriverOptionMenu.MenuNumber = Index;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ LocateSerialIo (
|
|||||||
if (CompareMem (&Acpi->HID, &Match, sizeof (UINT32)) == 0) {
|
if (CompareMem (&Acpi->HID, &Match, sizeof (UINT32)) == 0) {
|
||||||
NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT);
|
NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT);
|
||||||
if (NewMenuEntry == NULL) {
|
if (NewMenuEntry == NULL) {
|
||||||
SafeFreePool (Handles);
|
FreePool (Handles);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +472,9 @@ LocateSerialIo (
|
|||||||
TerminalMenu.MenuNumber++;
|
TerminalMenu.MenuNumber++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SafeFreePool (Handles);
|
if (Handles != NULL) {
|
||||||
|
FreePool (Handles);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get L"ConOut", L"ConIn" and L"ErrOut" from the Var
|
// Get L"ConOut", L"ConIn" and L"ErrOut" from the Var
|
||||||
@ -515,7 +517,9 @@ LocateSerialIo (
|
|||||||
NewTerminalContext->DevicePath,
|
NewTerminalContext->DevicePath,
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *) &Vendor
|
(EFI_DEVICE_PATH_PROTOCOL *) &Vendor
|
||||||
);
|
);
|
||||||
SafeFreePool (NewMenuEntry->HelpString);
|
if (NewMenuEntry->HelpString != NULL) {
|
||||||
|
FreePool (NewMenuEntry->HelpString);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// NewMenuEntry->HelpString = DevicePathToStr (NewDevicePath);
|
// NewMenuEntry->HelpString = DevicePathToStr (NewDevicePath);
|
||||||
// NewMenuEntry->DisplayString = NewMenuEntry->HelpString;
|
// NewMenuEntry->DisplayString = NewMenuEntry->HelpString;
|
||||||
@ -999,6 +1003,6 @@ GetConsoleOutMode (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FreePool (ModeInfo);
|
||||||
}
|
}
|
||||||
SafeFreePool (ModeInfo);
|
|
||||||
}
|
}
|
||||||
|
@ -549,7 +549,7 @@ UpdateOrderPage (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (IfrOptionList);
|
FreePool (IfrOptionList);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ UpdateBootNextPage (
|
|||||||
&gUpdateData
|
&gUpdateData
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (IfrOptionList);
|
FreePool (IfrOptionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
@ -771,8 +771,8 @@ UpdateConModePage (
|
|||||||
ValidMode,
|
ValidMode,
|
||||||
&gUpdateData
|
&gUpdateData
|
||||||
);
|
);
|
||||||
SafeFreePool (IfrOptionList);
|
FreePool (IfrOptionList);
|
||||||
SafeFreePool (ModeToken);
|
FreePool (ModeToken);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
}
|
}
|
||||||
@ -946,7 +946,7 @@ UpdateTerminalPage (
|
|||||||
&gUpdateData
|
&gUpdateData
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (IfrOptionList);
|
FreePool (IfrOptionList);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
}
|
}
|
||||||
@ -1063,14 +1063,14 @@ GetLegacyBootOptionVar (
|
|||||||
(BBS_BBS_DP == DevicePath->SubType)
|
(BBS_BBS_DP == DevicePath->SubType)
|
||||||
) {
|
) {
|
||||||
*OptionIndex = OrderBuffer[Index];
|
*OptionIndex = OrderBuffer[Index];
|
||||||
SafeFreePool (OrderBuffer);
|
FreePool (OrderBuffer);
|
||||||
return OptionBuffer;
|
return OptionBuffer;
|
||||||
} else {
|
} else {
|
||||||
SafeFreePool (OptionBuffer);
|
FreePool (OptionBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (OrderBuffer);
|
FreePool (OrderBuffer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1271,7 +1271,7 @@ UpdateSetLegacyDeviceOrderPage (
|
|||||||
CopyMem (OldData, LegacyOrder, 100);
|
CopyMem (OldData, LegacyOrder, 100);
|
||||||
|
|
||||||
if (IfrOptionList != NULL) {
|
if (IfrOptionList != NULL) {
|
||||||
SafeFreePool (IfrOptionList);
|
FreePool (IfrOptionList);
|
||||||
IfrOptionList = NULL;
|
IfrOptionList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ Var_ChangeBootOrder (
|
|||||||
//
|
//
|
||||||
if (BootOrderList != NULL) {
|
if (BootOrderList != NULL) {
|
||||||
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
||||||
SafeFreePool (BootOrderList);
|
FreePool (BootOrderList);
|
||||||
BootOrderList = NULL;
|
BootOrderList = NULL;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -268,7 +268,7 @@ Var_ChangeDriverOrder (
|
|||||||
//
|
//
|
||||||
if (DriverOrderList != NULL) {
|
if (DriverOrderList != NULL) {
|
||||||
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
|
||||||
SafeFreePool (DriverOrderList);
|
FreePool (DriverOrderList);
|
||||||
DriverOrderList = NULL;
|
DriverOrderList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,7 +407,7 @@ Var_UpdateConsoleOption (
|
|||||||
ConDevicePath = EfiLibGetVariable (ConsoleName, &gEfiGlobalVariableGuid);
|
ConDevicePath = EfiLibGetVariable (ConsoleName, &gEfiGlobalVariableGuid);
|
||||||
if (ConDevicePath != NULL) {
|
if (ConDevicePath != NULL) {
|
||||||
EfiLibDeleteVariable (ConsoleName, &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (ConsoleName, &gEfiGlobalVariableGuid);
|
||||||
SafeFreePool (ConDevicePath);
|
FreePool (ConDevicePath);
|
||||||
ConDevicePath = NULL;
|
ConDevicePath = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -689,10 +689,11 @@ Var_UpdateDriverOption (
|
|||||||
NewDriverOrderList
|
NewDriverOrderList
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
SafeFreePool (DriverOrderList);
|
if (DriverOrderList != NULL) {
|
||||||
|
FreePool (DriverOrderList);
|
||||||
|
}
|
||||||
DriverOrderList = NULL;
|
DriverOrderList = NULL;
|
||||||
SafeFreePool (NewDriverOrderList);
|
FreePool (NewDriverOrderList);
|
||||||
NewDriverOrderList = NULL;
|
|
||||||
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);
|
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);
|
||||||
DriverOptionMenu.MenuNumber++;
|
DriverOptionMenu.MenuNumber++;
|
||||||
|
|
||||||
@ -849,6 +850,7 @@ Var_UpdateBootOption (
|
|||||||
|
|
||||||
if (BootOrderList != NULL) {
|
if (BootOrderList != NULL) {
|
||||||
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
||||||
|
FreePool (BootOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
@ -860,9 +862,7 @@ Var_UpdateBootOption (
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
SafeFreePool (BootOrderList);
|
FreePool (NewBootOrderList);
|
||||||
BootOrderList = NULL;
|
|
||||||
SafeFreePool (NewBootOrderList);
|
|
||||||
NewBootOrderList = NULL;
|
NewBootOrderList = NULL;
|
||||||
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);
|
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);
|
||||||
BootOptionMenu.MenuNumber++;
|
BootOptionMenu.MenuNumber++;
|
||||||
@ -976,6 +976,7 @@ Var_UpdateBootOrder (
|
|||||||
//
|
//
|
||||||
if (BootOrderList != NULL) {
|
if (BootOrderList != NULL) {
|
||||||
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"BootOrder", &gEfiGlobalVariableGuid);
|
||||||
|
FreePool (BootOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
|
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
|
||||||
@ -989,8 +990,7 @@ Var_UpdateBootOrder (
|
|||||||
BootOrderListSize,
|
BootOrderListSize,
|
||||||
NewBootOrderList
|
NewBootOrderList
|
||||||
);
|
);
|
||||||
SafeFreePool (BootOrderList);
|
FreePool (NewBootOrderList);
|
||||||
SafeFreePool (NewBootOrderList);
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1048,6 +1048,7 @@ Var_UpdateDriverOrder (
|
|||||||
//
|
//
|
||||||
if (DriverOrderList != NULL) {
|
if (DriverOrderList != NULL) {
|
||||||
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
|
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
|
||||||
|
FreePool (DriverOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < DriverOrderListSize; Index++) {
|
for (Index = 0; Index < DriverOrderListSize; Index++) {
|
||||||
@ -1065,8 +1066,6 @@ Var_UpdateDriverOrder (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DriverOrderList);
|
|
||||||
|
|
||||||
BOpt_FreeMenu (&DriverOptionMenu);
|
BOpt_FreeMenu (&DriverOptionMenu);
|
||||||
BOpt_GetDriverOptions (CallbackData);
|
BOpt_GetDriverOptions (CallbackData);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1190,13 +1189,13 @@ Var_UpdateBBSOption (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (VarData >= VarData + VarSize) {
|
if (VarData >= VarData + VarSize) {
|
||||||
SafeFreePool (OriginalPtr);
|
FreePool (OriginalPtr);
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewOrder = (UINT16 *) AllocateZeroPool (DevOrder->Length - sizeof (UINT16));
|
NewOrder = (UINT16 *) AllocateZeroPool (DevOrder->Length - sizeof (UINT16));
|
||||||
if (NULL == NewOrder) {
|
if (NULL == NewOrder) {
|
||||||
SafeFreePool (VarData);
|
FreePool (VarData);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,7 +1228,7 @@ Var_UpdateBBSOption (
|
|||||||
NewOrder,
|
NewOrder,
|
||||||
DevOrder->Length - sizeof (UINT16)
|
DevOrder->Length - sizeof (UINT16)
|
||||||
);
|
);
|
||||||
SafeFreePool (NewOrder);
|
FreePool (NewOrder);
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
VAR_LEGACY_DEV_ORDER,
|
VAR_LEGACY_DEV_ORDER,
|
||||||
@ -1239,7 +1238,7 @@ Var_UpdateBBSOption (
|
|||||||
OriginalPtr
|
OriginalPtr
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (OriginalPtr);
|
FreePool (OriginalPtr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update Optional Data of Boot####
|
// Update Optional Data of Boot####
|
||||||
@ -1371,8 +1370,8 @@ Var_UpdateBBSOption (
|
|||||||
NewOptionPtr
|
NewOptionPtr
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (NewOptionPtr);
|
FreePool (NewOptionPtr);
|
||||||
SafeFreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOpt_GetBootOptions (CallbackData);
|
BOpt_GetBootOptions (CallbackData);
|
||||||
|
@ -795,7 +795,9 @@ ConPlatformMatchDevicePaths (
|
|||||||
TempDevicePath1,
|
TempDevicePath1,
|
||||||
DevicePathInst
|
DevicePathInst
|
||||||
);
|
);
|
||||||
SafeFreePool (TempDevicePath1);
|
if (TempDevicePath1 != NULL) {
|
||||||
|
FreePool (TempDevicePath1);
|
||||||
|
}
|
||||||
TempDevicePath1 = TempDevicePath2;
|
TempDevicePath1 = TempDevicePath2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,8 +393,8 @@ GraphicsConsoleControllerDriverStart (
|
|||||||
PackageList = HiiLibPreparePackageList (1, &mFontPackageListGuid, Package);
|
PackageList = HiiLibPreparePackageList (1, &mFontPackageListGuid, Package);
|
||||||
Status = mHiiDatabase->NewPackageList (mHiiDatabase, PackageList, NULL, &(Private->HiiHandle));
|
Status = mHiiDatabase->NewPackageList (mHiiDatabase, PackageList, NULL, &(Private->HiiHandle));
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
SafeFreePool (PackageList);
|
FreePool (PackageList);
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
|
|
||||||
mFirstAccessFlag = FALSE;
|
mFirstAccessFlag = FALSE;
|
||||||
}
|
}
|
||||||
@ -1205,8 +1205,10 @@ GraphicsConsoleConOutTestString (
|
|||||||
&Blt,
|
&Blt,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
SafeFreePool (Blt);
|
if (Blt != NULL) {
|
||||||
Blt = NULL;
|
FreePool (Blt);
|
||||||
|
Blt = NULL;
|
||||||
|
}
|
||||||
Count++;
|
Count++;
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
@ -1754,7 +1756,7 @@ DrawUnicodeWeightAtCursorN (
|
|||||||
|
|
||||||
String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight);
|
String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight);
|
||||||
if (String == NULL) {
|
if (String == NULL) {
|
||||||
SafeFreePool (Blt);
|
FreePool (Blt);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -1764,8 +1766,8 @@ DrawUnicodeWeightAtCursorN (
|
|||||||
|
|
||||||
FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
|
FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
|
||||||
if (FontInfo == NULL) {
|
if (FontInfo == NULL) {
|
||||||
SafeFreePool (Blt);
|
FreePool (Blt);
|
||||||
SafeFreePool (String);
|
FreePool (String);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -1803,8 +1805,8 @@ DrawUnicodeWeightAtCursorN (
|
|||||||
|
|
||||||
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||||
if (Blt->Image.Bitmap == NULL) {
|
if (Blt->Image.Bitmap == NULL) {
|
||||||
SafeFreePool (Blt);
|
FreePool (Blt);
|
||||||
SafeFreePool (String);
|
FreePool (String);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,15 +1849,21 @@ DrawUnicodeWeightAtCursorN (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (RowInfoArray);
|
FreePool (RowInfoArray);
|
||||||
SafeFreePool (Blt->Image.Bitmap);
|
FreePool (Blt->Image.Bitmap);
|
||||||
} else {
|
} else {
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Blt);
|
if (Blt != NULL) {
|
||||||
SafeFreePool (String);
|
FreePool (Blt);
|
||||||
SafeFreePool (FontInfo);
|
}
|
||||||
|
if (String != NULL) {
|
||||||
|
FreePool (String);
|
||||||
|
}
|
||||||
|
if (FontInfo != NULL) {
|
||||||
|
FreePool (FontInfo);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,5 +70,5 @@
|
|||||||
|
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiSimpleTextOutProtocolGuid AND gEfiHiiDatabaseProtocolGuid
|
gEfiSimpleTextOutProtocolGuid AND gEfiHiiDatabaseProtocolGuid AND gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ GetDevicePath (
|
|||||||
Length /= 2;
|
Length /= 2;
|
||||||
*DevicePath = (UINT8 *) AllocateZeroPool (Length);
|
*DevicePath = (UINT8 *) AllocateZeroPool (Length);
|
||||||
if (*DevicePath == NULL) {
|
if (*DevicePath == NULL) {
|
||||||
SafeFreePool (DevicePathString);
|
FreePool (DevicePathString);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
HexStringToBufInReverseOrder (*DevicePath, &Length, DevicePathString);
|
HexStringToBufInReverseOrder (*DevicePath, &Length, DevicePathString);
|
||||||
|
|
||||||
SafeFreePool (DevicePathString);
|
FreePool (DevicePathString);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
@ -202,7 +202,9 @@ ExportAllStorage (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (HandleBuffer);
|
if (HandleBuffer != NULL) {
|
||||||
|
FreePool (HandleBuffer);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,8 +221,8 @@ ExportAllStorage (
|
|||||||
Status = HiiExportPackageLists (HiiDatabase, HiiHandle, &BufferSize, HiiPackageList);
|
Status = HiiExportPackageLists (HiiDatabase, HiiHandle, &BufferSize, HiiPackageList);
|
||||||
}
|
}
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
SafeFreePool (HiiPackageList);
|
FreePool (HiiPackageList);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,9 +272,9 @@ ExportAllStorage (
|
|||||||
|
|
||||||
Status = HiiGetPackageListHandle (HiiDatabase, HiiHandle, &DriverHandle);
|
Status = HiiGetPackageListHandle (HiiDatabase, HiiHandle, &DriverHandle);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
SafeFreePool (HiiPackageList);
|
FreePool (HiiPackageList);
|
||||||
SafeFreePool (Storage);
|
FreePool (Storage);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
Storage->DriverHandle = DriverHandle;
|
Storage->DriverHandle = DriverHandle;
|
||||||
@ -305,10 +307,10 @@ ExportAllStorage (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (HiiPackageList);
|
FreePool (HiiPackageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -603,7 +605,9 @@ GetValueOfNumber (
|
|||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
SafeFreePool (Str);
|
if (Str != NULL) {
|
||||||
|
FreePool (Str);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,7 +742,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
//
|
//
|
||||||
Status = GetDevicePath (ConfigRequest, (UINT8 **) &DevicePath);
|
Status = GetDevicePath (ConfigRequest, (UINT8 **) &DevicePath);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,7 +769,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DevicePath);
|
FreePool (DevicePath);
|
||||||
|
|
||||||
if (DriverHandle == NULL) {
|
if (DriverHandle == NULL) {
|
||||||
//
|
//
|
||||||
@ -773,7 +777,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
// Set Progress to the 'G' in "GUID" of the routing header.
|
// Set Progress to the 'G' in "GUID" of the routing header.
|
||||||
//
|
//
|
||||||
*Progress = StringPtr;
|
*Progress = StringPtr;
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,7 +806,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);
|
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);
|
||||||
*Progress = TmpPtr;
|
*Progress = TmpPtr;
|
||||||
|
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -812,9 +816,9 @@ HiiConfigRoutingExtractConfig (
|
|||||||
ASSERT (*AccessProgress == 0);
|
ASSERT (*AccessProgress == 0);
|
||||||
Status = AppendToMultiString (Results, AccessResults);
|
Status = AppendToMultiString (Results, AccessResults);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
SafeFreePool (AccessResults);
|
FreePool (AccessResults);
|
||||||
AccessResults = NULL;
|
AccessResults = NULL;
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
ConfigRequest = NULL;
|
ConfigRequest = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -951,7 +955,7 @@ HiiConfigRoutingExportConfig (
|
|||||||
|
|
||||||
ConfigRequest = (EFI_STRING) AllocateZeroPool (RequestSize);
|
ConfigRequest = (EFI_STRING) AllocateZeroPool (RequestSize);
|
||||||
if (ConfigRequest == NULL) {
|
if (ConfigRequest == NULL) {
|
||||||
SafeFreePool (PathHdr);
|
FreePool (PathHdr);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -997,7 +1001,7 @@ HiiConfigRoutingExportConfig (
|
|||||||
StringPtr += StrLen (L"PATH=");
|
StringPtr += StrLen (L"PATH=");
|
||||||
StrCpy (StringPtr, PathHdr);
|
StrCpy (StringPtr, PathHdr);
|
||||||
|
|
||||||
SafeFreePool (PathHdr);
|
FreePool (PathHdr);
|
||||||
PathHdr = NULL;
|
PathHdr = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1021,6 +1025,8 @@ HiiConfigRoutingExportConfig (
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
AccessProgress = NULL;
|
||||||
|
AccessResults = NULL;
|
||||||
Status = ConfigAccess->ExtractConfig (
|
Status = ConfigAccess->ExtractConfig (
|
||||||
ConfigAccess,
|
ConfigAccess,
|
||||||
ConfigRequest,
|
ConfigRequest,
|
||||||
@ -1028,8 +1034,13 @@ HiiConfigRoutingExportConfig (
|
|||||||
&AccessResults
|
&AccessResults
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
SafeFreePool (AccessResults);
|
if (AccessProgress != NULL) {
|
||||||
|
FreePool (AccessProgress);
|
||||||
|
}
|
||||||
|
if (AccessResults != NULL) {
|
||||||
|
FreePool (AccessResults);
|
||||||
|
}
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1039,9 +1050,9 @@ HiiConfigRoutingExportConfig (
|
|||||||
ASSERT (*AccessProgress == 0);
|
ASSERT (*AccessProgress == 0);
|
||||||
Status = AppendToMultiString (Results, AccessResults);
|
Status = AppendToMultiString (Results, AccessResults);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
SafeFreePool (AccessResults);
|
FreePool (AccessResults);
|
||||||
AccessResults = NULL;
|
AccessResults = NULL;
|
||||||
SafeFreePool (ConfigRequest);
|
FreePool (ConfigRequest);
|
||||||
ConfigRequest = NULL;
|
ConfigRequest = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1057,8 +1068,8 @@ HiiConfigRoutingExportConfig (
|
|||||||
HII_FORMSET_STORAGE_SIGNATURE
|
HII_FORMSET_STORAGE_SIGNATURE
|
||||||
);
|
);
|
||||||
RemoveEntryList (&Storage->Entry);
|
RemoveEntryList (&Storage->Entry);
|
||||||
SafeFreePool (Storage->Name);
|
FreePool (Storage->Name);
|
||||||
SafeFreePool (Storage);
|
FreePool (Storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1173,7 +1184,7 @@ HiiConfigRoutingRouteConfig (
|
|||||||
//
|
//
|
||||||
Status = GetDevicePath (ConfigResp, (UINT8 **) &DevicePath);
|
Status = GetDevicePath (ConfigResp, (UINT8 **) &DevicePath);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (ConfigResp);
|
FreePool (ConfigResp);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1200,7 +1211,7 @@ HiiConfigRoutingRouteConfig (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (DevicePath);
|
FreePool (DevicePath);
|
||||||
|
|
||||||
if (DriverHandle == NULL) {
|
if (DriverHandle == NULL) {
|
||||||
//
|
//
|
||||||
@ -1208,7 +1219,7 @@ HiiConfigRoutingRouteConfig (
|
|||||||
// Set Progress to the 'G' in "GUID" of the routing header.
|
// Set Progress to the 'G' in "GUID" of the routing header.
|
||||||
//
|
//
|
||||||
*Progress = StringPtr;
|
*Progress = StringPtr;
|
||||||
SafeFreePool (ConfigResp);
|
FreePool (ConfigResp);
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1237,11 +1248,11 @@ HiiConfigRoutingRouteConfig (
|
|||||||
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);
|
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);
|
||||||
*Progress = TmpPtr;
|
*Progress = TmpPtr;
|
||||||
|
|
||||||
SafeFreePool (ConfigResp);
|
FreePool (ConfigResp);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (ConfigResp);
|
FreePool (ConfigResp);
|
||||||
ConfigResp = NULL;
|
ConfigResp = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1408,7 +1419,7 @@ HiiBlockToConfig (
|
|||||||
TmpBuffer,
|
TmpBuffer,
|
||||||
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
||||||
);
|
);
|
||||||
SafeFreePool (TmpBuffer);
|
FreePool (TmpBuffer);
|
||||||
|
|
||||||
StringPtr += Length;
|
StringPtr += Length;
|
||||||
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
|
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
|
||||||
@ -1432,7 +1443,7 @@ HiiBlockToConfig (
|
|||||||
TmpBuffer,
|
TmpBuffer,
|
||||||
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
||||||
);
|
);
|
||||||
SafeFreePool (TmpBuffer);
|
FreePool (TmpBuffer);
|
||||||
|
|
||||||
StringPtr += Length;
|
StringPtr += Length;
|
||||||
if (*StringPtr != 0 && *StringPtr != L'&') {
|
if (*StringPtr != 0 && *StringPtr != L'&') {
|
||||||
@ -1471,7 +1482,7 @@ HiiBlockToConfig (
|
|||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
ToLower (ValueStr);
|
ToLower (ValueStr);
|
||||||
|
|
||||||
SafeFreePool (Value);
|
FreePool (Value);
|
||||||
Value = NULL;
|
Value = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1493,8 +1504,8 @@ HiiBlockToConfig (
|
|||||||
|
|
||||||
AppendToMultiString (Config, ConfigElement);
|
AppendToMultiString (Config, ConfigElement);
|
||||||
|
|
||||||
SafeFreePool (ConfigElement);
|
FreePool (ConfigElement);
|
||||||
SafeFreePool (ValueStr);
|
FreePool (ValueStr);
|
||||||
ConfigElement = NULL;
|
ConfigElement = NULL;
|
||||||
ValueStr = NULL;
|
ValueStr = NULL;
|
||||||
|
|
||||||
@ -1519,11 +1530,16 @@ HiiBlockToConfig (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
FreePool (*Config);
|
||||||
SafeFreePool (*Config);
|
if (ValueStr != NULL) {
|
||||||
SafeFreePool (ValueStr);
|
FreePool (ValueStr);
|
||||||
SafeFreePool (Value);
|
}
|
||||||
SafeFreePool (ConfigElement);
|
if (Value != NULL) {
|
||||||
|
FreePool (Value);
|
||||||
|
}
|
||||||
|
if (ConfigElement) {
|
||||||
|
FreePool (ConfigElement);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
@ -1658,7 +1674,7 @@ HiiConfigToBlock (
|
|||||||
TmpBuffer,
|
TmpBuffer,
|
||||||
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
||||||
);
|
);
|
||||||
SafeFreePool (TmpBuffer);
|
FreePool (TmpBuffer);
|
||||||
|
|
||||||
StringPtr += Length;
|
StringPtr += Length;
|
||||||
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
|
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
|
||||||
@ -1682,7 +1698,7 @@ HiiConfigToBlock (
|
|||||||
TmpBuffer,
|
TmpBuffer,
|
||||||
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)
|
||||||
);
|
);
|
||||||
SafeFreePool (TmpBuffer);
|
FreePool (TmpBuffer);
|
||||||
|
|
||||||
StringPtr += Length;
|
StringPtr += Length;
|
||||||
if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) != 0) {
|
if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) != 0) {
|
||||||
@ -1719,7 +1735,7 @@ HiiConfigToBlock (
|
|||||||
CopyMem (Block + Offset, Value, Width);
|
CopyMem (Block + Offset, Value, Width);
|
||||||
*BlockSize = Offset + Width - 1;
|
*BlockSize = Offset + Width - 1;
|
||||||
|
|
||||||
SafeFreePool (Value);
|
FreePool (Value);
|
||||||
Value = NULL;
|
Value = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1743,7 +1759,9 @@ HiiConfigToBlock (
|
|||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
|
||||||
SafeFreePool (Value);
|
if (Value != NULL) {
|
||||||
|
FreePool (Value);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1983,11 +2001,21 @@ Exit:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (GuidStr);
|
if (GuidStr != NULL) {
|
||||||
SafeFreePool (NameStr);
|
FreePool (GuidStr);
|
||||||
SafeFreePool (PathStr);
|
}
|
||||||
SafeFreePool (AltIdStr);
|
if (NameStr != NULL) {
|
||||||
SafeFreePool (Result);
|
FreePool (NameStr);
|
||||||
|
}
|
||||||
|
if (PathStr != NULL) {
|
||||||
|
FreePool (PathStr);
|
||||||
|
}
|
||||||
|
if (AltIdStr != NULL) {
|
||||||
|
FreePool (AltIdStr);
|
||||||
|
}
|
||||||
|
if (Result != NULL) {
|
||||||
|
FreePool (Result);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ GenerateHiiDatabaseRecord (
|
|||||||
|
|
||||||
DatabaseRecord->PackageList = AllocateZeroPool (sizeof (HII_DATABASE_PACKAGE_LIST_INSTANCE));
|
DatabaseRecord->PackageList = AllocateZeroPool (sizeof (HII_DATABASE_PACKAGE_LIST_INSTANCE));
|
||||||
if (DatabaseRecord->PackageList == NULL) {
|
if (DatabaseRecord->PackageList == NULL) {
|
||||||
SafeFreePool (DatabaseRecord);
|
FreePool (DatabaseRecord);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ GenerateHiiDatabaseRecord (
|
|||||||
//
|
//
|
||||||
HiiHandle = (HII_HANDLE *) AllocateZeroPool (sizeof (HII_HANDLE));
|
HiiHandle = (HII_HANDLE *) AllocateZeroPool (sizeof (HII_HANDLE));
|
||||||
if (HiiHandle == NULL) {
|
if (HiiHandle == NULL) {
|
||||||
SafeFreePool (DatabaseRecord->PackageList);
|
FreePool (DatabaseRecord->PackageList);
|
||||||
SafeFreePool (DatabaseRecord);
|
FreePool (DatabaseRecord);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
HiiHandle->Signature = HII_HANDLE_SIGNATURE;
|
HiiHandle->Signature = HII_HANDLE_SIGNATURE;
|
||||||
@ -340,8 +340,9 @@ InvokeRegisteredFunction (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Buffer);
|
if (Buffer != NULL) {
|
||||||
Buffer = NULL;
|
FreePool (Buffer);
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -390,7 +391,7 @@ InsertGuidPackage (
|
|||||||
}
|
}
|
||||||
GuidPackage->GuidPkg = (UINT8 *) AllocateZeroPool (PackageHeader.Length);
|
GuidPackage->GuidPkg = (UINT8 *) AllocateZeroPool (PackageHeader.Length);
|
||||||
if (GuidPackage->GuidPkg == NULL) {
|
if (GuidPackage->GuidPkg == NULL) {
|
||||||
SafeFreePool (GuidPackage);
|
FreePool (GuidPackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,8 +525,8 @@ RemoveGuidPackages (
|
|||||||
RemoveEntryList (&Package->GuidEntry);
|
RemoveEntryList (&Package->GuidEntry);
|
||||||
CopyMem (&PackageHeader, Package->GuidPkg, sizeof (EFI_HII_PACKAGE_HEADER));
|
CopyMem (&PackageHeader, Package->GuidPkg, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||||
PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
|
PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
|
||||||
SafeFreePool (Package->GuidPkg);
|
FreePool (Package->GuidPkg);
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -579,7 +580,7 @@ InsertFormPackage (
|
|||||||
|
|
||||||
FormPackage->IfrData = (UINT8 *) AllocateZeroPool (PackageHeader.Length - sizeof (EFI_HII_PACKAGE_HEADER));
|
FormPackage->IfrData = (UINT8 *) AllocateZeroPool (PackageHeader.Length - sizeof (EFI_HII_PACKAGE_HEADER));
|
||||||
if (FormPackage->IfrData == NULL) {
|
if (FormPackage->IfrData == NULL) {
|
||||||
SafeFreePool (FormPackage);
|
FreePool (FormPackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,8 +739,8 @@ RemoveFormPackages (
|
|||||||
|
|
||||||
RemoveEntryList (&Package->IfrEntry);
|
RemoveEntryList (&Package->IfrEntry);
|
||||||
PackageList->PackageListHdr.PackageLength -= Package->FormPkgHdr.Length;
|
PackageList->PackageListHdr.PackageLength -= Package->FormPkgHdr.Length;
|
||||||
SafeFreePool (Package->IfrData);
|
FreePool (Package->IfrData);
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,11 +810,11 @@ InsertStringPackage (
|
|||||||
for (Link = PackageList->StringPkgHdr.ForwardLink; Link != &PackageList->StringPkgHdr; Link = Link->ForwardLink) {
|
for (Link = PackageList->StringPkgHdr.ForwardLink; Link != &PackageList->StringPkgHdr; Link = Link->ForwardLink) {
|
||||||
StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);
|
StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);
|
||||||
if (R8_EfiLibCompareLanguage (Language, StringPackage->StringPkgHdr->Language)) {
|
if (R8_EfiLibCompareLanguage (Language, StringPackage->StringPkgHdr->Language)) {
|
||||||
SafeFreePool (Language);
|
FreePool (Language);
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SafeFreePool (Language);
|
FreePool (Language);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create a String package node
|
// Create a String package node
|
||||||
@ -876,9 +877,15 @@ InsertStringPackage (
|
|||||||
|
|
||||||
Error:
|
Error:
|
||||||
|
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
if (StringPackage->StringBlock != NULL) {
|
||||||
SafeFreePool (StringPackage->StringPkgHdr);
|
FreePool (StringPackage->StringBlock);
|
||||||
SafeFreePool (StringPackage);
|
}
|
||||||
|
if (StringPackage->StringPkgHdr != NULL) {
|
||||||
|
FreePool (StringPackage->StringPkgHdr);
|
||||||
|
}
|
||||||
|
if (StringPackage != NULL) {
|
||||||
|
FreePool (StringPackage);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1014,8 +1021,8 @@ RemoveStringPackages (
|
|||||||
|
|
||||||
RemoveEntryList (&Package->StringEntry);
|
RemoveEntryList (&Package->StringEntry);
|
||||||
PackageList->PackageListHdr.PackageLength -= Package->StringPkgHdr->Header.Length;
|
PackageList->PackageListHdr.PackageLength -= Package->StringPkgHdr->Header.Length;
|
||||||
SafeFreePool (Package->StringBlock);
|
FreePool (Package->StringBlock);
|
||||||
SafeFreePool (Package->StringPkgHdr);
|
FreePool (Package->StringPkgHdr);
|
||||||
//
|
//
|
||||||
// Delete font information
|
// Delete font information
|
||||||
//
|
//
|
||||||
@ -1027,10 +1034,10 @@ RemoveStringPackages (
|
|||||||
HII_FONT_INFO_SIGNATURE
|
HII_FONT_INFO_SIGNATURE
|
||||||
);
|
);
|
||||||
RemoveEntryList (&FontInfo->Entry);
|
RemoveEntryList (&FontInfo->Entry);
|
||||||
SafeFreePool (FontInfo);
|
FreePool (FontInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1169,11 +1176,21 @@ InsertFontPackage (
|
|||||||
|
|
||||||
Error:
|
Error:
|
||||||
|
|
||||||
SafeFreePool (FontPkgHdr);
|
if (FontPkgHdr != NULL) {
|
||||||
SafeFreePool (FontInfo);
|
FreePool (FontPkgHdr);
|
||||||
SafeFreePool (FontPackage->GlyphBlock);
|
}
|
||||||
SafeFreePool (FontPackage);
|
if (FontInfo != NULL) {
|
||||||
SafeFreePool (GlobalFont);
|
FreePool (FontInfo);
|
||||||
|
}
|
||||||
|
if (FontPackage->GlyphBlock != NULL) {
|
||||||
|
FreePool (FontPackage->GlyphBlock);
|
||||||
|
}
|
||||||
|
if (FontPackage != NULL) {
|
||||||
|
FreePool (FontPackage);
|
||||||
|
}
|
||||||
|
if (GlobalFont != NULL) {
|
||||||
|
FreePool (GlobalFont);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
@ -1313,8 +1330,11 @@ RemoveFontPackages (
|
|||||||
|
|
||||||
RemoveEntryList (&Package->FontEntry);
|
RemoveEntryList (&Package->FontEntry);
|
||||||
PackageList->PackageListHdr.PackageLength -= Package->FontPkgHdr->Header.Length;
|
PackageList->PackageListHdr.PackageLength -= Package->FontPkgHdr->Header.Length;
|
||||||
SafeFreePool (Package->GlyphBlock);
|
|
||||||
SafeFreePool (Package->FontPkgHdr);
|
if (Package->GlyphBlock != NULL) {
|
||||||
|
FreePool (Package->GlyphBlock);
|
||||||
|
}
|
||||||
|
FreePool (Package->FontPkgHdr);
|
||||||
//
|
//
|
||||||
// Delete default character cell information
|
// Delete default character cell information
|
||||||
//
|
//
|
||||||
@ -1326,7 +1346,7 @@ RemoveFontPackages (
|
|||||||
HII_GLYPH_INFO_SIGNATURE
|
HII_GLYPH_INFO_SIGNATURE
|
||||||
);
|
);
|
||||||
RemoveEntryList (&GlyphInfo->Entry);
|
RemoveEntryList (&GlyphInfo->Entry);
|
||||||
SafeFreePool (GlyphInfo);
|
FreePool (GlyphInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1336,13 +1356,13 @@ RemoveFontPackages (
|
|||||||
GlobalFont = CR (Link, HII_GLOBAL_FONT_INFO, Entry, HII_GLOBAL_FONT_INFO_SIGNATURE);
|
GlobalFont = CR (Link, HII_GLOBAL_FONT_INFO, Entry, HII_GLOBAL_FONT_INFO_SIGNATURE);
|
||||||
if (GlobalFont->FontPackage == Package) {
|
if (GlobalFont->FontPackage == Package) {
|
||||||
RemoveEntryList (&GlobalFont->Entry);
|
RemoveEntryList (&GlobalFont->Entry);
|
||||||
SafeFreePool (GlobalFont->FontInfo);
|
FreePool (GlobalFont->FontInfo);
|
||||||
SafeFreePool (GlobalFont);
|
FreePool (GlobalFont);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1430,7 +1450,7 @@ InsertImagePackage (
|
|||||||
|
|
||||||
ImagePackage->PaletteBlock = (UINT8 *) AllocateZeroPool (PaletteSize);
|
ImagePackage->PaletteBlock = (UINT8 *) AllocateZeroPool (PaletteSize);
|
||||||
if (ImagePackage->PaletteBlock == NULL) {
|
if (ImagePackage->PaletteBlock == NULL) {
|
||||||
SafeFreePool (ImagePackage);
|
FreePool (ImagePackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
CopyMem (
|
CopyMem (
|
||||||
@ -1450,8 +1470,8 @@ InsertImagePackage (
|
|||||||
sizeof (EFI_HII_IMAGE_PACKAGE_HDR) - PaletteSize;
|
sizeof (EFI_HII_IMAGE_PACKAGE_HDR) - PaletteSize;
|
||||||
ImagePackage->ImageBlock = (UINT8 *) AllocateZeroPool (ImageSize);
|
ImagePackage->ImageBlock = (UINT8 *) AllocateZeroPool (ImageSize);
|
||||||
if (ImagePackage->ImageBlock == NULL) {
|
if (ImagePackage->ImageBlock == NULL) {
|
||||||
SafeFreePool (ImagePackage->PaletteBlock);
|
FreePool (ImagePackage->PaletteBlock);
|
||||||
SafeFreePool (ImagePackage);
|
FreePool (ImagePackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
CopyMem (
|
CopyMem (
|
||||||
@ -1611,9 +1631,11 @@ RemoveImagePackages (
|
|||||||
|
|
||||||
PackageList->PackageListHdr.PackageLength -= Package->ImagePkgHdr.Header.Length;
|
PackageList->PackageListHdr.PackageLength -= Package->ImagePkgHdr.Header.Length;
|
||||||
|
|
||||||
SafeFreePool (Package->ImageBlock);
|
FreePool (Package->ImageBlock);
|
||||||
SafeFreePool (Package->PaletteBlock);
|
if (Package->PaletteBlock != NULL) {
|
||||||
SafeFreePool (Package);
|
FreePool (Package->PaletteBlock);
|
||||||
|
}
|
||||||
|
FreePool (Package);
|
||||||
|
|
||||||
PackageList->ImagePkg = NULL;
|
PackageList->ImagePkg = NULL;
|
||||||
|
|
||||||
@ -1691,8 +1713,12 @@ InsertSimpleFontPackage (
|
|||||||
|
|
||||||
Error:
|
Error:
|
||||||
|
|
||||||
SafeFreePool (SimpleFontPackage->SimpleFontPkgHdr);
|
if (SimpleFontPackage->SimpleFontPkgHdr != NULL) {
|
||||||
SafeFreePool (SimpleFontPackage);
|
FreePool (SimpleFontPackage->SimpleFontPkgHdr);
|
||||||
|
}
|
||||||
|
if (SimpleFontPackage != NULL) {
|
||||||
|
FreePool (SimpleFontPackage);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1817,8 +1843,8 @@ RemoveSimpleFontPackages (
|
|||||||
|
|
||||||
RemoveEntryList (&Package->SimpleFontEntry);
|
RemoveEntryList (&Package->SimpleFontEntry);
|
||||||
PackageList->PackageListHdr.PackageLength -= Package->SimpleFontPkgHdr->Header.Length;
|
PackageList->PackageListHdr.PackageLength -= Package->SimpleFontPkgHdr->Header.Length;
|
||||||
SafeFreePool (Package->SimpleFontPkgHdr);
|
FreePool (Package->SimpleFontPkgHdr);
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -2003,7 +2029,7 @@ RemoveDevicePathPackage (
|
|||||||
CopyMem (&Header, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
CopyMem (&Header, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||||
PackageList->PackageListHdr.PackageLength -= Header.Length;
|
PackageList->PackageListHdr.PackageLength -= Header.Length;
|
||||||
|
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
|
|
||||||
PackageList->DevicePathPkg = NULL;
|
PackageList->DevicePathPkg = NULL;
|
||||||
|
|
||||||
@ -2132,8 +2158,12 @@ InsertKeyboardLayoutPackage (
|
|||||||
|
|
||||||
Error:
|
Error:
|
||||||
|
|
||||||
SafeFreePool (KeyboardLayoutPackage->KeyboardPkg);
|
if (KeyboardLayoutPackage->KeyboardPkg != NULL) {
|
||||||
SafeFreePool (KeyboardLayoutPackage);
|
FreePool (KeyboardLayoutPackage->KeyboardPkg);
|
||||||
|
}
|
||||||
|
if (KeyboardLayoutPackage != NULL) {
|
||||||
|
FreePool (KeyboardLayoutPackage);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -2265,8 +2295,8 @@ RemoveKeyboardLayoutPackages (
|
|||||||
RemoveEntryList (&Package->KeyboardEntry);
|
RemoveEntryList (&Package->KeyboardEntry);
|
||||||
CopyMem (&PackageHeader, Package->KeyboardPkg, sizeof (EFI_HII_PACKAGE_HEADER));
|
CopyMem (&PackageHeader, Package->KeyboardPkg, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||||
PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
|
PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
|
||||||
SafeFreePool (Package->KeyboardPkg);
|
FreePool (Package->KeyboardPkg);
|
||||||
SafeFreePool (Package);
|
FreePool (Package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -2850,9 +2880,9 @@ HiiRemovePackageList (
|
|||||||
ASSERT (Private->HiiHandleCount >= 0);
|
ASSERT (Private->HiiHandleCount >= 0);
|
||||||
|
|
||||||
HiiHandle->Signature = 0;
|
HiiHandle->Signature = 0;
|
||||||
SafeFreePool (HiiHandle);
|
FreePool (HiiHandle);
|
||||||
SafeFreePool (Node->PackageList);
|
FreePool (Node->PackageList);
|
||||||
SafeFreePool (Node);
|
FreePool (Node);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -3387,8 +3417,7 @@ HiiUnregisterPackageNotify (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
SafeFreePool (Notify);
|
FreePool (Notify);
|
||||||
Notify = NULL;
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -3670,7 +3699,9 @@ HiiSetKeyboardLayout (
|
|||||||
// Backup current keyboard layout.
|
// Backup current keyboard layout.
|
||||||
//
|
//
|
||||||
CopyMem (&Private->CurrentLayoutGuid, KeyGuid, sizeof (EFI_GUID));
|
CopyMem (&Private->CurrentLayoutGuid, KeyGuid, sizeof (EFI_GUID));
|
||||||
SafeFreePool(Private->CurrentLayout);
|
if (Private->CurrentLayout != NULL) {
|
||||||
|
FreePool(Private->CurrentLayout);
|
||||||
|
}
|
||||||
Private->CurrentLayout = KeyboardLayout;
|
Private->CurrentLayout = KeyboardLayout;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1024,7 +1024,9 @@ IsSystemFontInfo (
|
|||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
if (SystemInfo == NULL) {
|
if (SystemInfo == NULL) {
|
||||||
SafeFreePool (SystemDefault);
|
if (SystemDefault != NULL) {
|
||||||
|
FreePool (SystemDefault);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Flag;
|
return Flag;
|
||||||
}
|
}
|
||||||
@ -1646,7 +1648,9 @@ HiiStringToImage (
|
|||||||
Status = GetGlyphBuffer (Private, *StringPtr, FontInfo, &GlyphBuf[Index], &Cell[Index], &Attributes[Index]);
|
Status = GetGlyphBuffer (Private, *StringPtr, FontInfo, &GlyphBuf[Index], &Cell[Index], &Attributes[Index]);
|
||||||
if (Status == EFI_NOT_FOUND) {
|
if (Status == EFI_NOT_FOUND) {
|
||||||
if ((Flags & EFI_HII_IGNORE_IF_NO_GLYPH) == EFI_HII_IGNORE_IF_NO_GLYPH) {
|
if ((Flags & EFI_HII_IGNORE_IF_NO_GLYPH) == EFI_HII_IGNORE_IF_NO_GLYPH) {
|
||||||
SafeFreePool (GlyphBuf[Index]);
|
if (GlyphBuf[Index] != NULL) {
|
||||||
|
FreePool (GlyphBuf[Index]);
|
||||||
|
}
|
||||||
GlyphBuf[Index] = NULL;
|
GlyphBuf[Index] = NULL;
|
||||||
StringPtr++;
|
StringPtr++;
|
||||||
} else {
|
} else {
|
||||||
@ -1871,11 +1875,11 @@ HiiStringToImage (
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (BltBuffer);
|
FreePool (BltBuffer);
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BltBuffer);
|
FreePool (BltBuffer);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {
|
for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {
|
||||||
@ -1938,7 +1942,7 @@ HiiStringToImage (
|
|||||||
Image->Height = 600;
|
Image->Height = 600;
|
||||||
Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height *sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height *sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||||
if (Image->Image.Bitmap == NULL) {
|
if (Image->Image.Bitmap == NULL) {
|
||||||
SafeFreePool (Image);
|
FreePool (Image);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1970,16 +1974,34 @@ HiiStringToImage (
|
|||||||
Exit:
|
Exit:
|
||||||
|
|
||||||
for (Index = 0; Index < MAX_STRING_LENGTH; Index++) {
|
for (Index = 0; Index < MAX_STRING_LENGTH; Index++) {
|
||||||
SafeFreePool (GlyphBuf[Index]);
|
if (GlyphBuf[Index] != NULL) {
|
||||||
|
FreePool (GlyphBuf[Index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringIn != NULL) {
|
||||||
|
FreePool (StringIn);
|
||||||
|
}
|
||||||
|
if (StringIn2 != NULL) {
|
||||||
|
FreePool (StringIn2);
|
||||||
|
}
|
||||||
|
if (StringInfoOut != NULL) {
|
||||||
|
FreePool (StringInfoOut);
|
||||||
|
}
|
||||||
|
if (RowInfo != NULL) {
|
||||||
|
FreePool (RowInfo);
|
||||||
|
}
|
||||||
|
if (SystemDefault != NULL) {
|
||||||
|
FreePool (SystemDefault);
|
||||||
|
}
|
||||||
|
if (GlyphBuf != NULL) {
|
||||||
|
FreePool (GlyphBuf);
|
||||||
|
}
|
||||||
|
if (Cell != NULL) {
|
||||||
|
FreePool (Cell);
|
||||||
|
}
|
||||||
|
if (Attributes != NULL) {
|
||||||
|
FreePool (Attributes);
|
||||||
}
|
}
|
||||||
SafeFreePool (StringIn);
|
|
||||||
SafeFreePool (StringIn2);
|
|
||||||
SafeFreePool (StringInfoOut);
|
|
||||||
SafeFreePool (RowInfo);
|
|
||||||
SafeFreePool (SystemDefault);
|
|
||||||
SafeFreePool (GlyphBuf);
|
|
||||||
SafeFreePool (Cell);
|
|
||||||
SafeFreePool (Attributes);
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -2113,7 +2135,7 @@ HiiStringIdToImage (
|
|||||||
&StringFontInfo
|
&StringFontInfo
|
||||||
);
|
);
|
||||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
SafeFreePool (String);
|
FreePool (String);
|
||||||
String = (EFI_STRING) AllocateZeroPool (StringSize);
|
String = (EFI_STRING) AllocateZeroPool (StringSize);
|
||||||
if (String == NULL) {
|
if (String == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
@ -2180,9 +2202,15 @@ HiiStringIdToImage (
|
|||||||
);
|
);
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
SafeFreePool (String);
|
if (String != NULL) {
|
||||||
SafeFreePool (StringFontInfo);
|
FreePool (String);
|
||||||
SafeFreePool (NewStringInfo);
|
}
|
||||||
|
if (StringFontInfo != NULL) {
|
||||||
|
FreePool (StringFontInfo);
|
||||||
|
}
|
||||||
|
if (NewStringInfo != NULL) {
|
||||||
|
FreePool (NewStringInfo);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -2296,7 +2324,7 @@ HiiGetGlyph (
|
|||||||
|
|
||||||
Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||||
if (Image->Image.Bitmap == NULL) {
|
if (Image->Image.Bitmap == NULL) {
|
||||||
SafeFreePool (Image);
|
FreePool (Image);
|
||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
@ -2337,10 +2365,18 @@ Exit:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (SystemDefault);
|
if (SystemDefault != NULL) {
|
||||||
SafeFreePool (StringInfoOut);
|
FreePool (SystemDefault);
|
||||||
SafeFreePool (String);
|
}
|
||||||
SafeFreePool (GlyphBuffer);
|
if (StringInfoOut != NULL) {
|
||||||
|
FreePool (StringInfoOut);
|
||||||
|
}
|
||||||
|
if (String != NULL) {
|
||||||
|
FreePool (String);
|
||||||
|
}
|
||||||
|
if (GlyphBuffer != NULL) {
|
||||||
|
FreePool (GlyphBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -2539,8 +2575,12 @@ Exit:
|
|||||||
*FontHandle = LocalFontHandle;
|
*FontHandle = LocalFontHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (SystemDefault);
|
if (SystemDefault != NULL) {
|
||||||
SafeFreePool (FontInfo);
|
FreePool (SystemDefault);
|
||||||
|
}
|
||||||
|
if (FontInfo != NULL) {
|
||||||
|
FreePool (FontInfo);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ Output1bitPixel (
|
|||||||
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
||||||
CopyRgbToGopPixel (&PaletteValue[0], &Palette->PaletteValue[0], 1);
|
CopyRgbToGopPixel (&PaletteValue[0], &Palette->PaletteValue[0], 1);
|
||||||
CopyRgbToGopPixel (&PaletteValue[1], &Palette->PaletteValue[1], 1);
|
CopyRgbToGopPixel (&PaletteValue[1], &Palette->PaletteValue[1], 1);
|
||||||
SafeFreePool (Palette);
|
FreePool (Palette);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert the pixel from one bit to corresponding color.
|
// Convert the pixel from one bit to corresponding color.
|
||||||
@ -373,7 +373,7 @@ Output4bitPixel (
|
|||||||
|
|
||||||
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
||||||
CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, PaletteNum);
|
CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, PaletteNum);
|
||||||
SafeFreePool (Palette);
|
FreePool (Palette);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert the pixel from 4 bit to corresponding color.
|
// Convert the pixel from 4 bit to corresponding color.
|
||||||
@ -446,7 +446,7 @@ Output8bitPixel (
|
|||||||
PaletteNum = (UINT16)(Palette->PaletteSize / sizeof (EFI_HII_RGB_PIXEL));
|
PaletteNum = (UINT16)(Palette->PaletteSize / sizeof (EFI_HII_RGB_PIXEL));
|
||||||
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
ZeroMem (PaletteValue, sizeof (PaletteValue));
|
||||||
CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, PaletteNum);
|
CopyRgbToGopPixel (PaletteValue, Palette->PaletteValue, PaletteNum);
|
||||||
SafeFreePool (Palette);
|
FreePool (Palette);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert the pixel from 8 bits to corresponding color.
|
// Convert the pixel from 8 bits to corresponding color.
|
||||||
@ -679,7 +679,7 @@ HiiNewImage (
|
|||||||
ImagePackage->ImageBlock,
|
ImagePackage->ImageBlock,
|
||||||
ImagePackage->ImageBlockSize - sizeof (EFI_HII_IIBT_END_BLOCK)
|
ImagePackage->ImageBlockSize - sizeof (EFI_HII_IIBT_END_BLOCK)
|
||||||
);
|
);
|
||||||
SafeFreePool (ImagePackage->ImageBlock);
|
FreePool (ImagePackage->ImageBlock);
|
||||||
ImagePackage->ImageBlock = ImageBlock;
|
ImagePackage->ImageBlock = ImageBlock;
|
||||||
ImageBlock += ImagePackage->ImageBlockSize - sizeof (EFI_HII_IIBT_END_BLOCK);
|
ImageBlock += ImagePackage->ImageBlockSize - sizeof (EFI_HII_IIBT_END_BLOCK);
|
||||||
//
|
//
|
||||||
@ -687,8 +687,7 @@ HiiNewImage (
|
|||||||
//
|
//
|
||||||
NewBlock = AllocateZeroPool (NewBlockSize);
|
NewBlock = AllocateZeroPool (NewBlockSize);
|
||||||
if (NewBlock == NULL) {
|
if (NewBlock == NULL) {
|
||||||
SafeFreePool (ImagePackage->ImageBlock);
|
FreePool (ImagePackage->ImageBlock);
|
||||||
ImagePackage->ImageBlock = NULL;
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
NewBlockPtr = NewBlock;
|
NewBlockPtr = NewBlock;
|
||||||
@ -735,7 +734,7 @@ HiiNewImage (
|
|||||||
ImagePackage->ImageBlockSize = (UINT32) BlockSize;
|
ImagePackage->ImageBlockSize = (UINT32) BlockSize;
|
||||||
ImagePackage->ImageBlock = (UINT8 *) AllocateZeroPool (BlockSize);
|
ImagePackage->ImageBlock = (UINT8 *) AllocateZeroPool (BlockSize);
|
||||||
if (ImagePackage->ImageBlock == NULL) {
|
if (ImagePackage->ImageBlock == NULL) {
|
||||||
SafeFreePool (ImagePackage);
|
FreePool (ImagePackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
ImageBlock = ImagePackage->ImageBlock;
|
ImageBlock = ImagePackage->ImageBlock;
|
||||||
@ -745,8 +744,8 @@ HiiNewImage (
|
|||||||
//
|
//
|
||||||
NewBlock = AllocateZeroPool (NewBlockSize);
|
NewBlock = AllocateZeroPool (NewBlockSize);
|
||||||
if (NewBlock == NULL) {
|
if (NewBlock == NULL) {
|
||||||
SafeFreePool (ImagePackage->ImageBlock);
|
FreePool (ImagePackage->ImageBlock);
|
||||||
SafeFreePool (ImagePackage);
|
FreePool (ImagePackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
NewBlockPtr = NewBlock;
|
NewBlockPtr = NewBlock;
|
||||||
@ -774,7 +773,7 @@ HiiNewImage (
|
|||||||
CopyGopToRgbPixel ((EFI_HII_RGB_PIXEL *) NewBlock, ImageIn->Bitmap, ImageIn->Width * ImageIn->Height);
|
CopyGopToRgbPixel ((EFI_HII_RGB_PIXEL *) NewBlock, ImageIn->Bitmap, ImageIn->Width * ImageIn->Height);
|
||||||
|
|
||||||
CopyMem (ImageBlock, NewBlockPtr, NewBlockSize);
|
CopyMem (ImageBlock, NewBlockPtr, NewBlockSize);
|
||||||
SafeFreePool (NewBlockPtr);
|
FreePool (NewBlockPtr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Append the block end
|
// Append the block end
|
||||||
@ -1156,7 +1155,7 @@ HiiSetImage (
|
|||||||
BlockSize = ImagePackage->ImageBlockSize + NewBlockSize - OldBlockSize;
|
BlockSize = ImagePackage->ImageBlockSize + NewBlockSize - OldBlockSize;
|
||||||
Block = (UINT8 *) AllocateZeroPool (BlockSize);
|
Block = (UINT8 *) AllocateZeroPool (BlockSize);
|
||||||
if (Block == NULL) {
|
if (Block == NULL) {
|
||||||
SafeFreePool (NewBlock);
|
FreePool (NewBlock);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1169,8 +1168,8 @@ HiiSetImage (
|
|||||||
BlockPtr += NewBlockSize;
|
BlockPtr += NewBlockSize;
|
||||||
CopyMem (BlockPtr, ImageBlock + OldBlockSize, Part2Size);
|
CopyMem (BlockPtr, ImageBlock + OldBlockSize, Part2Size);
|
||||||
|
|
||||||
SafeFreePool (ImagePackage->ImageBlock);
|
FreePool (ImagePackage->ImageBlock);
|
||||||
SafeFreePool (NewBlock);
|
FreePool (NewBlock);
|
||||||
ImagePackage->ImageBlock = Block;
|
ImagePackage->ImageBlock = Block;
|
||||||
ImagePackage->ImageBlockSize = BlockSize;
|
ImagePackage->ImageBlockSize = BlockSize;
|
||||||
ImagePackage->ImagePkgHdr.Header.Length += NewBlockSize - OldBlockSize;
|
ImagePackage->ImagePkgHdr.Header.Length += NewBlockSize - OldBlockSize;
|
||||||
@ -1366,7 +1365,7 @@ HiiDrawImage (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (BltBuffer);
|
FreePool (BltBuffer);
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1384,7 +1383,7 @@ HiiDrawImage (
|
|||||||
|
|
||||||
ImageOut = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
|
ImageOut = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
|
||||||
if (ImageOut == NULL) {
|
if (ImageOut == NULL) {
|
||||||
SafeFreePool (BltBuffer);
|
FreePool (BltBuffer);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
ImageOut->Width = (UINT16) Width;
|
ImageOut->Width = (UINT16) Width;
|
||||||
@ -1397,14 +1396,14 @@ HiiDrawImage (
|
|||||||
//
|
//
|
||||||
Status = GetSystemFont (Private, &FontInfo, NULL);
|
Status = GetSystemFont (Private, &FontInfo, NULL);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SafeFreePool (BltBuffer);
|
FreePool (BltBuffer);
|
||||||
SafeFreePool (ImageOut);
|
FreePool (ImageOut);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
for (Index = 0; Index < Width * Height; Index++) {
|
for (Index = 0; Index < Width * Height; Index++) {
|
||||||
BltBuffer[Index] = FontInfo->BackgroundColor;
|
BltBuffer[Index] = FontInfo->BackgroundColor;
|
||||||
}
|
}
|
||||||
SafeFreePool (FontInfo);
|
FreePool (FontInfo);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw the incoming image to the new created image.
|
// Draw the incoming image to the new created image.
|
||||||
@ -1494,7 +1493,9 @@ HiiDrawImageId (
|
|||||||
// Draw this image.
|
// Draw this image.
|
||||||
//
|
//
|
||||||
Status = HiiDrawImage (This, Flags, &Image, Blt, BltX, BltY);
|
Status = HiiDrawImage (This, Flags, &Image, Blt, BltX, BltY);
|
||||||
SafeFreePool (Image.Bitmap);
|
if (Image.Bitmap != NULL) {
|
||||||
|
FreePool (Image.Bitmap);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ FindStringBlock (
|
|||||||
//
|
//
|
||||||
StringPackage->FontId++;
|
StringPackage->FontId++;
|
||||||
|
|
||||||
SafeFreePool (FontInfo);
|
FreePool (FontInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockSize += Ext2.Length;
|
BlockSize += Ext2.Length;
|
||||||
@ -814,7 +814,7 @@ SetStringWorker (
|
|||||||
TmpSize
|
TmpSize
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = Block;
|
StringPackage->StringBlock = Block;
|
||||||
StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize);
|
StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize);
|
||||||
break;
|
break;
|
||||||
@ -847,7 +847,7 @@ SetStringWorker (
|
|||||||
OldBlockSize - (StringTextPtr - StringPackage->StringBlock) - StringSize
|
OldBlockSize - (StringTextPtr - StringPackage->StringBlock) - StringSize
|
||||||
);
|
);
|
||||||
|
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = Block;
|
StringPackage->StringBlock = Block;
|
||||||
StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize);
|
StringPackage->StringPkgHdr->Header.Length += (UINT32) (BlockSize - OldBlockSize);
|
||||||
break;
|
break;
|
||||||
@ -898,7 +898,7 @@ SetStringWorker (
|
|||||||
|
|
||||||
CopyMem (BlockPtr, StringPackage->StringBlock, OldBlockSize);
|
CopyMem (BlockPtr, StringPackage->StringBlock, OldBlockSize);
|
||||||
|
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = Block;
|
StringPackage->StringBlock = Block;
|
||||||
StringPackage->StringPkgHdr->Header.Length += Ext2.Length;
|
StringPackage->StringPkgHdr->Header.Length += Ext2.Length;
|
||||||
|
|
||||||
@ -1043,7 +1043,7 @@ HiiNewString (
|
|||||||
HeaderSize = (UINT32) (AsciiStrSize ((CHAR8 *) Language) - 1 + sizeof (EFI_HII_STRING_PACKAGE_HDR));
|
HeaderSize = (UINT32) (AsciiStrSize ((CHAR8 *) Language) - 1 + sizeof (EFI_HII_STRING_PACKAGE_HDR));
|
||||||
StringPackage->StringPkgHdr = AllocateZeroPool (HeaderSize);
|
StringPackage->StringPkgHdr = AllocateZeroPool (HeaderSize);
|
||||||
if (StringPackage->StringPkgHdr == NULL) {
|
if (StringPackage->StringPkgHdr == NULL) {
|
||||||
SafeFreePool (StringPackage);
|
FreePool (StringPackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
StringPackage->StringPkgHdr->Header.Type = EFI_HII_PACKAGE_STRINGS;
|
StringPackage->StringPkgHdr->Header.Type = EFI_HII_PACKAGE_STRINGS;
|
||||||
@ -1063,8 +1063,8 @@ HiiNewString (
|
|||||||
BlockSize = Ucs2BlockSize + sizeof (EFI_HII_SIBT_END_BLOCK);
|
BlockSize = Ucs2BlockSize + sizeof (EFI_HII_SIBT_END_BLOCK);
|
||||||
StringPackage->StringBlock = (UINT8 *) AllocateZeroPool (BlockSize);
|
StringPackage->StringBlock = (UINT8 *) AllocateZeroPool (BlockSize);
|
||||||
if (StringPackage->StringBlock == NULL) {
|
if (StringPackage->StringBlock == NULL) {
|
||||||
SafeFreePool (StringPackage->StringPkgHdr);
|
FreePool (StringPackage->StringPkgHdr);
|
||||||
SafeFreePool (StringPackage);
|
FreePool (StringPackage);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1139,7 +1139,7 @@ HiiNewString (
|
|||||||
// Append a EFI_HII_SIBT_END block to the end.
|
// Append a EFI_HII_SIBT_END block to the end.
|
||||||
//
|
//
|
||||||
*BlockPtr = EFI_HII_SIBT_END;
|
*BlockPtr = EFI_HII_SIBT_END;
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = StringBlock;
|
StringPackage->StringBlock = StringBlock;
|
||||||
StringPackage->StringPkgHdr->Header.Length += Ucs2BlockSize;
|
StringPackage->StringPkgHdr->Header.Length += Ucs2BlockSize;
|
||||||
PackageListNode->PackageListHdr.PackageLength += Ucs2BlockSize;
|
PackageListNode->PackageListHdr.PackageLength += Ucs2BlockSize;
|
||||||
@ -1180,7 +1180,7 @@ HiiNewString (
|
|||||||
// Append a EFI_HII_SIBT_END block to the end.
|
// Append a EFI_HII_SIBT_END block to the end.
|
||||||
//
|
//
|
||||||
*BlockPtr = EFI_HII_SIBT_END;
|
*BlockPtr = EFI_HII_SIBT_END;
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = StringBlock;
|
StringPackage->StringBlock = StringBlock;
|
||||||
StringPackage->StringPkgHdr->Header.Length += Ucs2FontBlockSize;
|
StringPackage->StringPkgHdr->Header.Length += Ucs2FontBlockSize;
|
||||||
PackageListNode->PackageListHdr.PackageLength += Ucs2FontBlockSize;
|
PackageListNode->PackageListHdr.PackageLength += Ucs2FontBlockSize;
|
||||||
@ -1240,7 +1240,7 @@ HiiNewString (
|
|||||||
// Append a EFI_HII_SIBT_END block to the end.
|
// Append a EFI_HII_SIBT_END block to the end.
|
||||||
//
|
//
|
||||||
*BlockPtr = EFI_HII_SIBT_END;
|
*BlockPtr = EFI_HII_SIBT_END;
|
||||||
SafeFreePool (StringPackage->StringBlock);
|
FreePool (StringPackage->StringBlock);
|
||||||
StringPackage->StringBlock = StringBlock;
|
StringPackage->StringBlock = StringBlock;
|
||||||
StringPackage->StringPkgHdr->Header.Length += FontBlockSize + Ucs2FontBlockSize;
|
StringPackage->StringPkgHdr->Header.Length += FontBlockSize + Ucs2FontBlockSize;
|
||||||
PackageListNode->PackageListHdr.PackageLength += FontBlockSize + Ucs2FontBlockSize;
|
PackageListNode->PackageListHdr.PackageLength += FontBlockSize + Ucs2FontBlockSize;
|
||||||
|
@ -712,9 +712,15 @@ IfrCatenate (
|
|||||||
Result->Value.string = NewString (StringPtr, FormSet->HiiHandle);
|
Result->Value.string = NewString (StringPtr, FormSet->HiiHandle);
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
SafeFreePool (String[0]);
|
if (String[0] != NULL) {
|
||||||
SafeFreePool (String[1]);
|
FreePool (String[0]);
|
||||||
SafeFreePool (StringPtr);
|
}
|
||||||
|
if (String[1] != NULL) {
|
||||||
|
FreePool (String[1]);
|
||||||
|
}
|
||||||
|
if (StringPtr != NULL) {
|
||||||
|
FreePool (StringPtr);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -770,8 +776,12 @@ IfrMatch (
|
|||||||
Result->Value.b = mUnicodeCollation->MetaiMatch (mUnicodeCollation, String[0], String[1]);
|
Result->Value.b = mUnicodeCollation->MetaiMatch (mUnicodeCollation, String[0], String[1]);
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
SafeFreePool (String[0]);
|
if (String[0] != NULL) {
|
||||||
SafeFreePool (String[1]);
|
FreePool (String[0]);
|
||||||
|
}
|
||||||
|
if (String[1] != NULL) {
|
||||||
|
FreePool (String[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -855,8 +865,12 @@ IfrFind (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
SafeFreePool (String[0]);
|
if (String[0] != NULL) {
|
||||||
SafeFreePool (String[1]);
|
FreePool (String[0]);
|
||||||
|
}
|
||||||
|
if (String[1] != NULL) {
|
||||||
|
FreePool (String[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1025,8 +1039,12 @@ IfrToken (
|
|||||||
Result->Value.string = NewString (SubString, FormSet->HiiHandle);
|
Result->Value.string = NewString (SubString, FormSet->HiiHandle);
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
SafeFreePool (String[0]);
|
if (String[0] != NULL) {
|
||||||
SafeFreePool (String[1]);
|
FreePool (String[0]);
|
||||||
|
}
|
||||||
|
if (String[1] != NULL) {
|
||||||
|
FreePool (String[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1129,8 +1147,12 @@ IfrSpan (
|
|||||||
Result->Value.u64 = StringPtr - String[1];
|
Result->Value.u64 = StringPtr - String[1];
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
SafeFreePool (String[0]);
|
if (String[0] != NULL) {
|
||||||
SafeFreePool (String[1]);
|
FreePool (String[0]);
|
||||||
|
}
|
||||||
|
if (String[1] != NULL) {
|
||||||
|
FreePool (String[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,9 @@ DestroyExpression (
|
|||||||
OpCode = EXPRESSION_OPCODE_FROM_LINK (Link);
|
OpCode = EXPRESSION_OPCODE_FROM_LINK (Link);
|
||||||
RemoveEntryList (&OpCode->Link);
|
RemoveEntryList (&OpCode->Link);
|
||||||
|
|
||||||
SafeFreePool (OpCode->ValueList);
|
if (OpCode->ValueList != NULL) {
|
||||||
|
FreePool (OpCode->ValueList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -473,25 +475,41 @@ DestroyStorage (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Storage->Name);
|
if (Storage->Name != NULL) {
|
||||||
SafeFreePool (Storage->Buffer);
|
FreePool (Storage->Name);
|
||||||
SafeFreePool (Storage->EditBuffer);
|
}
|
||||||
|
if (Storage->Buffer != NULL) {
|
||||||
|
FreePool (Storage->Buffer);
|
||||||
|
}
|
||||||
|
if (Storage->EditBuffer != NULL) {
|
||||||
|
FreePool (Storage->EditBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
while (!IsListEmpty (&Storage->NameValueListHead)) {
|
while (!IsListEmpty (&Storage->NameValueListHead)) {
|
||||||
Link = GetFirstNode (&Storage->NameValueListHead);
|
Link = GetFirstNode (&Storage->NameValueListHead);
|
||||||
NameValueNode = NAME_VALUE_NODE_FROM_LINK (Link);
|
NameValueNode = NAME_VALUE_NODE_FROM_LINK (Link);
|
||||||
RemoveEntryList (&NameValueNode->Link);
|
RemoveEntryList (&NameValueNode->Link);
|
||||||
|
|
||||||
SafeFreePool (NameValueNode->Name);
|
if (NameValueNode->Name != NULL) {
|
||||||
SafeFreePool (NameValueNode->Value);
|
FreePool (NameValueNode->Name);
|
||||||
SafeFreePool (NameValueNode->EditValue);
|
}
|
||||||
SafeFreePool (NameValueNode);
|
if (NameValueNode->Value != NULL) {
|
||||||
|
FreePool (NameValueNode->Value);
|
||||||
|
}
|
||||||
|
if (NameValueNode->EditValue != NULL) {
|
||||||
|
FreePool (NameValueNode->EditValue);
|
||||||
|
}
|
||||||
|
FreePool (NameValueNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Storage->ConfigHdr);
|
if (Storage->ConfigHdr != NULL) {
|
||||||
SafeFreePool (Storage->ConfigRequest);
|
FreePool (Storage->ConfigHdr);
|
||||||
|
}
|
||||||
|
if (Storage->ConfigRequest != NULL) {
|
||||||
|
FreePool (Storage->ConfigRequest);
|
||||||
|
}
|
||||||
|
|
||||||
gBS->FreePool (Storage);
|
FreePool (Storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -555,8 +573,12 @@ DestroyStatement (
|
|||||||
DestroyExpression (Expression);
|
DestroyExpression (Expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (Statement->VariableName);
|
if (Statement->VariableName != NULL) {
|
||||||
SafeFreePool (Statement->BlockName);
|
FreePool (Statement->VariableName);
|
||||||
|
}
|
||||||
|
if (Statement->BlockName != NULL) {
|
||||||
|
FreePool (Statement->BlockName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -623,7 +645,7 @@ DestroyFormSet (
|
|||||||
//
|
//
|
||||||
// Free IFR binary buffer
|
// Free IFR binary buffer
|
||||||
//
|
//
|
||||||
SafeFreePool (FormSet->IfrBinaryData);
|
FreePool (FormSet->IfrBinaryData);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Free FormSet Storage
|
// Free FormSet Storage
|
||||||
@ -664,10 +686,14 @@ DestroyFormSet (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeFreePool (FormSet->StatementBuffer);
|
if (FormSet->StatementBuffer != NULL) {
|
||||||
SafeFreePool (FormSet->ExpressionBuffer);
|
FreePool (FormSet->StatementBuffer);
|
||||||
|
}
|
||||||
|
if (FormSet->ExpressionBuffer != NULL) {
|
||||||
|
FreePool (FormSet->ExpressionBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
SafeFreePool (FormSet);
|
FreePool (FormSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -611,34 +611,34 @@ FreeBrowserStrings (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SafeFreePool (gFunctionOneString);
|
FreePool (gFunctionOneString);
|
||||||
SafeFreePool (gFunctionTwoString);
|
FreePool (gFunctionTwoString);
|
||||||
SafeFreePool (gFunctionNineString);
|
FreePool (gFunctionNineString);
|
||||||
SafeFreePool (gFunctionTenString);
|
FreePool (gFunctionTenString);
|
||||||
SafeFreePool (gEnterString);
|
FreePool (gEnterString);
|
||||||
SafeFreePool (gEnterCommitString);
|
FreePool (gEnterCommitString);
|
||||||
SafeFreePool (gEscapeString);
|
FreePool (gEscapeString);
|
||||||
SafeFreePool (gMoveHighlight);
|
FreePool (gMoveHighlight);
|
||||||
SafeFreePool (gMakeSelection);
|
FreePool (gMakeSelection);
|
||||||
SafeFreePool (gDecNumericInput);
|
FreePool (gDecNumericInput);
|
||||||
SafeFreePool (gHexNumericInput);
|
FreePool (gHexNumericInput);
|
||||||
SafeFreePool (gToggleCheckBox);
|
FreePool (gToggleCheckBox);
|
||||||
SafeFreePool (gPromptForData);
|
FreePool (gPromptForData);
|
||||||
SafeFreePool (gPromptForPassword);
|
FreePool (gPromptForPassword);
|
||||||
SafeFreePool (gPromptForNewPassword);
|
FreePool (gPromptForNewPassword);
|
||||||
SafeFreePool (gConfirmPassword);
|
FreePool (gConfirmPassword);
|
||||||
SafeFreePool (gPassowordInvalid);
|
FreePool (gPassowordInvalid);
|
||||||
SafeFreePool (gConfirmError);
|
FreePool (gConfirmError);
|
||||||
SafeFreePool (gPressEnter);
|
FreePool (gPressEnter);
|
||||||
SafeFreePool (gEmptyString);
|
FreePool (gEmptyString);
|
||||||
SafeFreePool (gAreYouSure);
|
FreePool (gAreYouSure);
|
||||||
SafeFreePool (gYesResponse);
|
FreePool (gYesResponse);
|
||||||
SafeFreePool (gNoResponse);
|
FreePool (gNoResponse);
|
||||||
SafeFreePool (gMiniString);
|
FreePool (gMiniString);
|
||||||
SafeFreePool (gPlusString);
|
FreePool (gPlusString);
|
||||||
SafeFreePool (gMinusString);
|
FreePool (gMinusString);
|
||||||
SafeFreePool (gAdjustNumber);
|
FreePool (gAdjustNumber);
|
||||||
SafeFreePool (gSaveChanges);
|
FreePool (gSaveChanges);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,7 +724,9 @@ NewStringCpy (
|
|||||||
IN CHAR16 *Src
|
IN CHAR16 *Src
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SafeFreePool (*Dest);
|
if (*Dest != NULL) {
|
||||||
|
FreePool (*Dest);
|
||||||
|
}
|
||||||
*Dest = AllocateCopyPool (StrSize (Src), Src);
|
*Dest = AllocateCopyPool (StrSize (Src), Src);
|
||||||
ASSERT (*Dest != NULL);
|
ASSERT (*Dest != NULL);
|
||||||
}
|
}
|
||||||
@ -865,7 +867,9 @@ SetValueByName (
|
|||||||
Node = NAME_VALUE_NODE_FROM_LINK (Link);
|
Node = NAME_VALUE_NODE_FROM_LINK (Link);
|
||||||
|
|
||||||
if (StrCmp (Name, Node->Name) == 0) {
|
if (StrCmp (Name, Node->Name) == 0) {
|
||||||
SafeFreePool (Node->EditValue);
|
if (Node->EditValue != NULL) {
|
||||||
|
FreePool (Node->EditValue);
|
||||||
|
}
|
||||||
Node->EditValue = AllocateCopyPool (StrSize (Value), Value);
|
Node->EditValue = AllocateCopyPool (StrSize (Value), Value);
|
||||||
ASSERT (Node->EditValue != NULL);
|
ASSERT (Node->EditValue != NULL);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
@ -2137,7 +2137,9 @@ UiDisplayMenu (
|
|||||||
gDirection = SCAN_LEFT;
|
gDirection = SCAN_LEFT;
|
||||||
}
|
}
|
||||||
Status = ProcessOptions (Selection, MenuOption, TRUE, &OptionString);
|
Status = ProcessOptions (Selection, MenuOption, TRUE, &OptionString);
|
||||||
SafeFreePool (OptionString);
|
if (OptionString != NULL) {
|
||||||
|
FreePool (OptionString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user