/** @file\r
EFI Firmware Volume routines which work on a Fv image in buffers.\r
\r
-Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
Status = FvBufClearAllFiles (TempFv);\r
if (EFI_ERROR (Status)) {\r
+ CommonLibBinderFree (TempFv);\r
return Status;\r
}\r
\r
\r
if (*DestinationFv == NULL) {\r
*DestinationFv = CommonLibBinderAllocate (size);\r
+ if (*DestinationFv == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
\r
CommonLibBinderCopyMem (*DestinationFv, SourceFv, size);\r
IN UINTN Size\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
\r
This function calculates the UINT16 sum for the requested region.\r
IN UINTN Size\r
)\r
/*++\r
- \r
+\r
Routine Description::\r
\r
This function calculates the value needed for a valid UINT16 checksum\r