EFI_STATUS Status;\r
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
UINT32 AuthenticationStatus;\r
- VOID* TempBuffer;\r
\r
ASSERT (NameGuid != NULL);\r
ASSERT (Buffer != NULL);\r
);\r
}\r
\r
- if (!EFI_ERROR (Status)) {\r
- //\r
- // The found buffer by FV protocol is allocated by gBS AllocatePool() service. \r
- // Copy the found buffer to the allocated buffer by AllocatePool().\r
- // So, the returned buffer can be freed by FreePool().\r
- //\r
- TempBuffer = AllocateCopyPool (*Size, *Buffer);\r
- gBS->FreePool (*Buffer);\r
- *Buffer = TempBuffer;\r
- }\r
-\r
return Status;\r
}\r
\r
\r
Done:\r
if (HandleBuffer != NULL) { \r
- //\r
- // HandleBuffer is allocated by gBS AllocatePool() service. \r
- // So, gBS FreePool() service is used to free HandleBuffer.\r
- //\r
- gBS->FreePool (HandleBuffer);\r
+ FreePool(HandleBuffer);\r
}\r
\r
return Status;\r
\r
Done:\r
\r
- if (HandleBuffer != NULL) {\r
- //\r
- // HandleBuffer is allocated by gBS AllocatePool() service. \r
- // So, gBS FreePool() service is used to free HandleBuffer.\r
- //\r
- gBS->FreePool (HandleBuffer);\r
+ if (HandleBuffer != NULL) { \r
+ FreePool(HandleBuffer);\r
}\r
return Status;\r
\r
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;\r
EFI_SECTION_TYPE SectionType;\r
UINT8 *ImageBuffer;\r
- UINT8 *TempBuffer;\r
UINTN ImageBufferSize;\r
EFI_FV_FILETYPE Type;\r
EFI_FV_FILE_ATTRIBUTES Attrib;\r
FileInfo = NULL;\r
FileHandle = NULL;\r
ImageBuffer = NULL;\r
- TempBuffer = NULL;\r
ImageBufferSize = 0;\r
*AuthenticationStatus = 0;\r
\r
AuthenticationStatus\r
);\r
}\r
- if (!EFI_ERROR (Status)) {\r
- //\r
- // The found buffer by FV protocol is allocated by gBS AllocatePool() service. \r
- // Copy the found buffer to the allocated buffer by AllocatePool().\r
- // Then, this returned buffer can be freed by FreePool().\r
- //\r
- TempBuffer = AllocateCopyPool (ImageBufferSize, ImageBuffer);\r
- gBS->FreePool (ImageBuffer);\r
- ImageBuffer = TempBuffer;\r
- }\r
}\r
}\r
goto Finish;\r