Length /= 2;\r
*DevicePath = (UINT8 *) AllocateZeroPool (Length);\r
if (*DevicePath == NULL) {\r
- SafeFreePool (DevicePathString);\r
+ FreePool (DevicePathString);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
HexStringToBufInReverseOrder (*DevicePath, &Length, DevicePathString);\r
\r
- SafeFreePool (DevicePathString);\r
+ FreePool (DevicePathString);\r
\r
return EFI_SUCCESS;\r
\r
);\r
}\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (HandleBuffer);\r
+ if (HandleBuffer != NULL) {\r
+ FreePool (HandleBuffer);\r
+ }\r
return Status;\r
}\r
\r
Status = HiiExportPackageLists (HiiDatabase, HiiHandle, &BufferSize, HiiPackageList);\r
}\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (HandleBuffer);\r
- SafeFreePool (HiiPackageList);\r
+ FreePool (HandleBuffer);\r
+ FreePool (HiiPackageList);\r
return Status;\r
}\r
\r
\r
Status = HiiGetPackageListHandle (HiiDatabase, HiiHandle, &DriverHandle);\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (HandleBuffer);\r
- SafeFreePool (HiiPackageList);\r
- SafeFreePool (Storage);\r
+ FreePool (HandleBuffer);\r
+ FreePool (HiiPackageList);\r
+ FreePool (Storage);\r
return Status;\r
}\r
Storage->DriverHandle = DriverHandle;\r
}\r
}\r
\r
- SafeFreePool (HiiPackageList);\r
+ FreePool (HiiPackageList);\r
}\r
\r
- SafeFreePool (HandleBuffer);\r
+ FreePool (HandleBuffer);\r
\r
return EFI_SUCCESS;\r
}\r
Status = EFI_SUCCESS;\r
\r
Exit:\r
- SafeFreePool (Str);\r
+ if (Str != NULL) {\r
+ FreePool (Str);\r
+ }\r
return Status;\r
}\r
\r
//\r
Status = GetDevicePath (ConfigRequest, (UINT8 **) &DevicePath);\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (ConfigRequest);\r
+ FreePool (ConfigRequest);\r
return Status;\r
}\r
\r
}\r
}\r
\r
- SafeFreePool (DevicePath);\r
+ FreePool (DevicePath);\r
\r
if (DriverHandle == NULL) {\r
//\r
// Set Progress to the 'G' in "GUID" of the routing header.\r
//\r
*Progress = StringPtr;\r
- SafeFreePool (ConfigRequest);\r
+ FreePool (ConfigRequest);\r
return EFI_NOT_FOUND;\r
}\r
\r
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);\r
*Progress = TmpPtr;\r
\r
- SafeFreePool (ConfigRequest);\r
+ FreePool (ConfigRequest);\r
return Status;\r
}\r
\r
ASSERT (*AccessProgress == 0);\r
Status = AppendToMultiString (Results, AccessResults);\r
ASSERT_EFI_ERROR (Status);\r
- SafeFreePool (AccessResults);\r
+ FreePool (AccessResults);\r
AccessResults = NULL;\r
- SafeFreePool (ConfigRequest);\r
+ FreePool (ConfigRequest);\r
ConfigRequest = NULL;\r
\r
//\r
\r
ConfigRequest = (EFI_STRING) AllocateZeroPool (RequestSize);\r
if (ConfigRequest == NULL) {\r
- SafeFreePool (PathHdr);\r
+ FreePool (PathHdr);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
StringPtr += StrLen (L"PATH=");\r
StrCpy (StringPtr, PathHdr);\r
\r
- SafeFreePool (PathHdr);\r
+ FreePool (PathHdr);\r
PathHdr = NULL;\r
\r
//\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ AccessProgress = NULL;\r
+ AccessResults = NULL;\r
Status = ConfigAccess->ExtractConfig (\r
ConfigAccess,\r
ConfigRequest,\r
&AccessResults\r
);\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (ConfigRequest);\r
- SafeFreePool (AccessResults);\r
+ FreePool (ConfigRequest);\r
+ if (AccessProgress != NULL) {\r
+ FreePool (AccessProgress);\r
+ }\r
+ if (AccessResults != NULL) {\r
+ FreePool (AccessResults);\r
+ }\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
ASSERT (*AccessProgress == 0);\r
Status = AppendToMultiString (Results, AccessResults);\r
ASSERT_EFI_ERROR (Status);\r
- SafeFreePool (AccessResults);\r
+ FreePool (AccessResults);\r
AccessResults = NULL;\r
- SafeFreePool (ConfigRequest);\r
+ FreePool (ConfigRequest);\r
ConfigRequest = NULL;\r
\r
}\r
HII_FORMSET_STORAGE_SIGNATURE\r
);\r
RemoveEntryList (&Storage->Entry);\r
- SafeFreePool (Storage->Name);\r
- SafeFreePool (Storage);\r
+ FreePool (Storage->Name);\r
+ FreePool (Storage);\r
}\r
\r
return EFI_SUCCESS;\r
//\r
Status = GetDevicePath (ConfigResp, (UINT8 **) &DevicePath);\r
if (EFI_ERROR (Status)) {\r
- SafeFreePool (ConfigResp);\r
+ FreePool (ConfigResp);\r
return Status;\r
}\r
\r
}\r
}\r
\r
- SafeFreePool (DevicePath);\r
+ FreePool (DevicePath);\r
\r
if (DriverHandle == NULL) {\r
//\r
// Set Progress to the 'G' in "GUID" of the routing header.\r
//\r
*Progress = StringPtr;\r
- SafeFreePool (ConfigResp);\r
+ FreePool (ConfigResp);\r
return EFI_NOT_FOUND;\r
}\r
\r
for (TmpPtr = StringPtr; CompareMem (TmpPtr, AccessProgress, RemainSize) != 0; TmpPtr++);\r
*Progress = TmpPtr;\r
\r
- SafeFreePool (ConfigResp);\r
+ FreePool (ConfigResp);\r
return Status;\r
}\r
\r
- SafeFreePool (ConfigResp);\r
+ FreePool (ConfigResp);\r
ConfigResp = NULL;\r
\r
//\r
TmpBuffer,\r
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)\r
);\r
- SafeFreePool (TmpBuffer);\r
+ FreePool (TmpBuffer);\r
\r
StringPtr += Length;\r
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {\r
TmpBuffer,\r
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)\r
);\r
- SafeFreePool (TmpBuffer);\r
+ FreePool (TmpBuffer);\r
\r
StringPtr += Length;\r
if (*StringPtr != 0 && *StringPtr != L'&') {\r
ASSERT_EFI_ERROR (Status);\r
ToLower (ValueStr);\r
\r
- SafeFreePool (Value);\r
+ FreePool (Value);\r
Value = NULL;\r
\r
//\r
\r
AppendToMultiString (Config, ConfigElement);\r
\r
- SafeFreePool (ConfigElement);\r
- SafeFreePool (ValueStr);\r
+ FreePool (ConfigElement);\r
+ FreePool (ValueStr);\r
ConfigElement = NULL;\r
ValueStr = NULL;\r
\r
return EFI_SUCCESS;\r
\r
Exit:\r
-\r
- SafeFreePool (*Config);\r
- SafeFreePool (ValueStr);\r
- SafeFreePool (Value);\r
- SafeFreePool (ConfigElement);\r
+ FreePool (*Config);\r
+ if (ValueStr != NULL) {\r
+ FreePool (ValueStr);\r
+ }\r
+ if (Value != NULL) {\r
+ FreePool (Value);\r
+ }\r
+ if (ConfigElement) {\r
+ FreePool (ConfigElement);\r
+ }\r
\r
return Status;\r
\r
TmpBuffer,\r
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)\r
);\r
- SafeFreePool (TmpBuffer);\r
+ FreePool (TmpBuffer);\r
\r
StringPtr += Length;\r
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {\r
TmpBuffer,\r
(((Length + 1) / 2) < sizeof (UINTN)) ? ((Length + 1) / 2) : sizeof (UINTN)\r
);\r
- SafeFreePool (TmpBuffer);\r
+ FreePool (TmpBuffer);\r
\r
StringPtr += Length;\r
if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) != 0) {\r
CopyMem (Block + Offset, Value, Width);\r
*BlockSize = Offset + Width - 1;\r
\r
- SafeFreePool (Value);\r
+ FreePool (Value);\r
Value = NULL;\r
\r
//\r
\r
Exit:\r
\r
- SafeFreePool (Value);\r
+ if (Value != NULL) {\r
+ FreePool (Value);\r
+ }\r
return Status;\r
}\r
\r
}\r
}\r
\r
- SafeFreePool (GuidStr);\r
- SafeFreePool (NameStr);\r
- SafeFreePool (PathStr);\r
- SafeFreePool (AltIdStr);\r
- SafeFreePool (Result);\r
+ if (GuidStr != NULL) {\r
+ FreePool (GuidStr);\r
+ }\r
+ if (NameStr != NULL) {\r
+ FreePool (NameStr);\r
+ }\r
+ if (PathStr != NULL) {\r
+ FreePool (PathStr);\r
+ }\r
+ if (AltIdStr != NULL) {\r
+ FreePool (AltIdStr);\r
+ }\r
+ if (Result != NULL) {\r
+ FreePool (Result);\r
+ }\r
\r
return Status;\r
\r